
CHAPTER 23
Thejavax.swing Package
This large package contains the most important classes and interfaces of Swing.
Swing is a core part of Java 1.2 and is also available as a standard extension to
Java 1.1. The GUI component classes are at the heart of Swing. These classes have
names that begin with the letter J. Figur e 23-1 shows the hierarchy of Swing com-
ponents in javax.swing. Note that this diagram does not show the fact that all the
Swing components implement javax.accessibility.Accessible; see the individual class
synopses for this information.
Most Swing components rely on a model object to hold their state information.
Various interfaces define the methods that these state objects must implement, and
various abstract and concrete classes implement these interfaces. These model
inter faces and classes are recognizable by the word “Model” in their names. Figure
23-2 shows the model objects and layout managers in javax.swing.
Classes with the word “Manager” in their names typically manage some important
part of the Swing user-inter face or application environment. Other important
classes and interfaces defined by this package include: Action, Icon, KeyStroke, Timer,
and SwingUtilities. Figur e 23-3 shows the rest of the classes and interfaces in
javax.swing.
All Swing components are accessible, which means that they implement the
javax.accessiblity.Accessible inter face and define getAccessibleContext() ...