Java Reference
In-Depth Information
LISTING 9.8
Continued
23: public static void main(String[] arguments) {
24: Subscriptions app = new Subscriptions();
25: }
26: }
The application is shown in Figure 9.7. The Subscriptions application has an interface
with a label atop a list displaying eight items. A scrollpane is used in lines 17-18 to
enable the list to be scrolled to see items 9 and 10.
9
FIGURE 9.7
The Subscriptions
application.
Summary
Today, you began working with Swing, the package of classes that enables you to offer a
graphical user interface in your Java programs.
You used more than a dozen classes today, creating interface components such as but-
tons, labels, and text fields. You put each of these into containers: components that
include panels, frames, and windows.
Programming of this kind can be complex, and Swing represents the largest package of
classes that a new Java programmer must deal with in learning the language.
However, as you have experienced with components such as text areas and text fields,
Swing components have many superclasses in common. This makes it easier to extend
your knowledge into new components and containers, as well as the other aspects of
Swing programming you will explore over the next three days.
 
 
Search WWH ::




Custom Search