Discoverhow to enhance your Java applications by leveraging new web capabilities available through Webswing Modernisation Framework. Learn the next steps for modernising your app after transitioning it to the web.
Webswing offers four complementary modernisation approaches, each tailored to different goals, effort levels, and flexibility needs. These approaches can be mixed and matched to achieve your desired outcomes. Choose the right combination to enhance your application's capabilities and user experience.
Web-enable lets you bring basic web capabilities to your Java applications without significant rewrites. This non-intrusive method allows you to integrate features like single sign-on (SSO), URL navigation, touch input support, or embedding in other native web applications. Key advantages include ease of implementation, low coding effort, preservation of your existing business logic, and low maintenance costs.
While perfect for quick modernisation wins, this approach is best suited for improving the user experience of your existing Swing application. It is not the optimal choice for a complex UX transformation or addressing significant technical debt. It's an ideal starting point when facing immediate needs with a time or resource-constrained modernisation effort.
A mid-sized enterprise with the legacy Java application, while functional, lacks modern features essential for streamlined workflows. They want to integrate single-sign-on (SSO) for user convenience, enhance the interface with updated visuals, and enable URL-based navigation to specific sections within the application. A complete rewrite is costly and time-consuming.
The company adopts Webswing and its "Web-Enable Swing" approach. With this framework, the core Swing application logic remains untouched. Webswing embeds the application within a web environment while providing APIs to bridge the gap between Swing and modern web technologies.
Developers seamlessly integrate their existing SSO system with the Swing application. They use web technologies (HTML, CSS, JavaScript) to enhance the user interface alongside the core Swing portions. URL navigation is implemented, allowing users to bookmark and share specific inventory views. The application gains a contemporary feel while preserving its critical business functionality.
The Extend approach lets you seamlessly add web-based features to your existing Java application. Supercharge your application with capabilities like interactive web maps, JavaScript charting libraries, reporting tools, or rich video/audio content.
This approach allows for targeted modernisation without a complete rewrite, minimizing disruptions and keeping technical debt in check. New web-based components work side-by-side with your native Swing elements, preserving your critical business logic.
The Facelift approach efficiently transforms the UI of your Java application. By simply changing the look and feel in Swing, you can switch between web and Swing rendering without rewriting your business logic. The component tree logic remains intact; only the rendering logic is modified, and this change is reversible.
This method is perfect for preserving critical business logic while enhancing the user interface. Updating the rendering to native web components improves testability and user experience, making it easier to refine your application's appearance.
A telecommunication corporation's existing Java Swing application had a functional backend, but the outdated user interface negatively impacted user experience (UX). They were hesitant to undertake a complete system rewrite due to the inherent risks and potential disruptions.
The company adopted Webswing's Modernisation Framework, specifically the "Facelift" approach. This enabled them to revamp the application's frontend using modern web technologies (HTML5, CSS3) while preserving the entire backend logic.
The "Facelift" approach delivered a visually appealing and intuitive new user interface. This modernisation significantly improved user experience while minimizing risk by avoiding major backend changes.
While the Rebuild approach requires more development effort, it is the most flexible in the long run. It's the best choice for complex applications where a strategic, step-by-step transition is essential for business continuity. This approach allows you to incrementally rebuild sections of your application using the technology of your choice. You can prioritize high-value features for modernisation first, delivering user benefits while gradually transforming the entire application. This approach also helps you progressively reduce your technical debt over time.
A large enterprise had a complex, mission-critical Java Swing application that needed modernisation, but a complete rewrite introduced too much risk and potential disruption to their business operations.
The company adopted Webswing's Modernisation Framework with the "Rebuild" approach. This enabled a phased transition, allowing them to gradually rewrite sections of the application using web technologies while integrating these new components seamlessly with the remaining legacy Swing parts within the browser. The "Rebuild" approach facilitated a controlled, step-by-step modernisation to a fully web-based application. This minimized business disruption and downtime, mitigating the risks associated with a complete overhaul. Even with some complex elements remaining in Swing, Webswing ensured their smooth operation within the modernised environment, providing a cost-effective and strategic modernisation path.
Wizard dialogs are ubiquitous in today's desktop applications. What exactly is a wizard dialog? Well, you've likely run across several wizard dialogs already, either when you're installing a pre-packaged application, or you're configuring a series of program options. In this article, I will create a framework for a simple wizard dialog that you can extend as necessary.
A wizard dialog is constructed with a number of panels, and each panel contains user-configurable components such as radio buttons, sliders, or text fields. The idea here is that the application user, by pressing either the Next or Back buttons, can "flip" across these panels, entering information on each one until he or she completes the path. At this point, the Next button often changes to a Finish button, and when pressed, the dialog will close. The instantiating class should then be able to retrieve all of the data that was entered. At any time, the user can also press the Cancel button to quit the dialog and discard any data that has been entered so far.
If you're getting the impression that numbering our panels with an integer code is a bad idea, that's exactly right. It's often better to give each panel an Object identifier, such as a string. Then, when we need to move forward or backward, we can ask the current panel for the identifier of the next panel or the previous panel that it should traverse to. Note that the next and previous panel identifiers returned by the current panel are not guaranteed to remain constant, and may change based on context and user input.
Wizard - This class, including its model and controller, is responsible for the outer JDialog, as well as the Next, Back, and Cancel buttons. It is also contains a large component in the center that uses the AWT CardLayout layout manager to "flip" through multiple wizard panels in the same space. Think of it as the outer shell of the wizard dialog. Graphically, it looks like Figure 1.
Subclass of java.awt.Component - The second element is simply a class that extends java.awt.Component, often a javax.swing.JPanel. This class acts the inner content of the wizard dialog-one of several panels that will be displayed by the Wizard. Figure 2 below shows an example of a JPanel that contains an ImageIcon on the left, in conjunction with several lines of text on the right.
WizardPanelDescriptor - This third class is the means to connect the components on the inside with the wizard dialog on the outside. This is a class that is extended by the user to provide a means of identifying the panel's Component class to the Wizard, its unique Object-based identifier, links to the current WizardPanelDescriptor classes representing the next and previous panels, and hook routines that are executed before, during, and after the panel is displayed.
The first thing that we need to create is the class that represents the outer shell of the wizard dialog itself. We know already that we need three buttons in this area: a Back button, a Next button, and a Cancel button. Typically, these buttons appear in that order, from left to right, and the lower right side of the dialog. Also, the Cancel button is typically offset slightly from the other two buttons - this is primarily so that the user doesn't accidentally press the Cancel button if they are clicking back and forth rapidly across the panels. Next, we need a layout manager that will allow us to display a number of panels in the same spot, flipping back and forth among a number of them as needed. Luckily, AWT provided us with such a layout manager for use with component such as JTabbedPane: the CardLayout.
Note that the constructor that is listed here calls a private helper method entitled initComponents(). Here is the source code for that method, which simply lays out the interior and surrounding buttons in the typical wizard dialog fashion, and connects the buttons to the controller.
Next, there needs to be a way to register the Component panels with the layout manager and the model. Wizard uses the registerWizardPanel() method for this. Note that the CardLayout manager does have methods that cycle back and forth across the panels as they have been added to it (that is, next() and previous()). However, because of the tree-like structure that we need to use, it's better for the dialog to display them using the Object identifier and not try to enforce a linear path. Here is the method:
3a8082e126