O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The SwingGUIDemo Program

The following program demonstrates some of the basics of programming with Swing and highlights some of the interesting features of the GUI, such as being able outchange the look and feel of the GUI programmatically. This program generates the window shown in Figure 30-5.

Figure 30-5. The swing GUI demonstration program.

The code for the SwingGUIDemo class is shown in the listing below. The SwingGUIDemo class extends JFrame, allowing us to call JFrame methods directly as instance methods. The application manages the placement of components using the default layout manager for the JFrame the BorderLayout layout manager. In ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required