Some reader favorites:
EJB fundamentals and session beans
Create a scrollable virtual desktop in Swing
Wizard API updated!
Tim Boudreau has released a new version of the Swing Wizard library (version 0.997) that fixes the WizardException bug reported in JavaWorld's recent Open Source Java Project profile. The article's examples have been reworked to test out the new, improved WizardException. Thanks, Tim, for this helpful fix!
Open Source Java Projects: The Wizard API
In an enterprise or application service provider (ASP) environment, the console provides a window into a system's operation and allows operators to configure and control the system in real time. The console can also display unprompted status information and announcements.
In this article, I'll show you how to construct a generic console from Swing components that uses the Java Messaging Service (JMS) to interact with one or more application subsystems. JMS provides a standard solution to the problem of communication between the backend system's command servers and their clients.
Figure 1 shows the console client's on-screen appearance. The user types commands in the interface's lower box (JTextField) and receives an answer in the text area above it. The dot before the command indicates that the command goes to the console
itself rather than to the connected host or queue. When text fills the text area, scroll bars automatically appear.

Figure 1. The console in action with the default Metal look and feel
Rather than create a distributed communication system in one step, we will build up to the finished product in stages. First, we will construct a basic console that operates synchronously using a socket. This introduces the Swing fundamentals and demonstrates how to build a functional console without the extra JMS complexities. Then we will extend our basic console with useful features, such as tabbed panes. Finally, we will add JMS for industrial-strength communications.
The biggest hurdle to starting with Swing is understanding its underlying object model. Your application or applet must sit above a complex web of classes with subtle and hidden interactions. Later in this article, I will cover some other important topics, such as event threads and peers. To get started, you just need to know the component model. Mastering this foundation takes time, but the inheritance outline below may give you a leg up on the learning curve:
Swing's inheritance model
java.awt.Component (abstract)
java.awt.Container
javax.swing.JComponent (abstract)
javax.swing.JRootPane
...other concrete components (JPanel, JTree etc.)
java.awt.Window
java.awt.Panel
java.applet.Applet
javax.swing.JApplet
javax.swing.JWindow
java.awt.Dialog
javax.swing.JDialog
java.awt.Frame
javax.swing.JFrame
The top-level Swing components (JApplet, JWindow, JDialog, and JFrame) are in bold above. Each of these containers has only one component, JRootPane. The diagram below illustrates the JRootPane -- the key to Swing.

Figure 2. The organization of Swing's JRootPane
The root pane has a glass pane on top and a layered pane underneath. The layered pane is composed of a MenuBar and a ContentPane. You add subcomponents to your outer container via the content pane. When you use a component's getContentPane() method, you are actually getting its root pane's content pane.
Free Download - 5 Minute Product Review. When slow equals Off: Manage the complexity of Web applications - Symphoniq
![]()
Free Download - 5 Minute Product Review. Realize the benefits of real user monitoring in less than an hour. - Symphoniq