
CHAPTER 1
TheJavaFoundation Classes
The Java Foundation Classes, or JFC, is a loose collection of standard Java APIs for
client-side graphics, graphical user interfaces (GUIs), and related programming
tasks. They are foundation classes in the sense that most client-side Java applica-
tions are built upon these APIs. This book covers the following APIs:
AW T
Although the most powerful and exciting features of the JFC were intr oduced
in Version 1.2 of the Java 2 platform, the JFC also includes the graphics and
GUI features of Java 1.0 and Java 1.1. These features are provided by the
Abstract Windowing Toolkit (AWT). The graphics and GUI capabilities of the
AWT are rudimentary, and many of them have been superseded by more
advanced features in Java 1.2. Nevertheless, the AWT is the bedrock upon
which more advanced JFC functionality is built.
In addition, there are certain situations in which you cannot take advantage of
the new JFC functionality and must instead rely solely on the AWT. For exam-
ple, common web browsers do not yet support Swing, so if you are writing
applets, you have to use the AWT. Because of this, the graphics and GUI APIs
of the AWT are discussed right along with the more power ful APIs introduced
in Java 1.2.
Swing
Swing is an advanced GUI toolkit written in pure Java. It is built upon the
AWT but provides many new GUI components and useful GUI-related appli-
cation services. Swing ...