Java Reference
In-Depth Information
Table 1-1. AWT to Swing Component Mapping (Continued)
AWT Component
Nearest Swing Replacement
Menu
JMenu
MenuBar
JMenuBar
MenuItem
JMenuItem
Panel
JPanel
PopupMenu
JPopupMenu
Scrollbar
JScrollBar
ScrollPane
JScrollPane
TextArea
JTextArea
TextField
JTextField
Note For most people, the fact that the Swing components replace AWT components is irrelevant.
Just treat the Swing components as an independent component set, and you'll be perfectly okay.
To help you understand how to use the Swing components, you'll examine each of the
components in this topic. For instance, Chapter 4 looks at how the JButton component works,
with just a single line of text as its label, like an AWT Button , but adds capabilities, such as using
image icons on buttons and working with multiple lines of text. To find out where each compo-
nent is discussed in this topic, see the “Swing Component to Chapter Mapping” section later in
this chapter.
In addition to replacing each of the basic components, the Swing component set has a
replacement for the higher-level window objects. Although the only change in most of the
components' names is the beginning J , you'll discover in Chapter 8 how the high-level container
objects are much different in the Swing world. Swing's replacement for the old FileDialog object
differs even more and is discussed in Chapter 9. Table 1-2 maps the high-level window objects
from the AWT component world to the Swing universe.
Table 1-2. AWT to Swing Window Mapping
AWT Window
Nearest Swing Replacement
Applet
JApplet
Dialog
JDialog
FileDialog
JFileChooser
Frame
JFrame
Window
JWindow
 
Search WWH ::




Custom Search