Java Reference
In-Depth Information
java.lang. Object
java.awt. Component
AWT Components
java.awt. Container
java.awt.Window
java.awt.Panel
javax.swing. JComponent
java.awt.Frame
java.awt.Dialog
java.awt.Applet
javax.swing.JPanel
Swing Components
javax.swing.JWindow
javax.swing.JFrame
javax.swing.JDialog
javax.swing.JApplet
figure 11-6  
There they are. Note how things are a bit complicated ( JPanel for instance does not extend the
AWT Panel), but the main classes you'll be working with are all part of Swing, all starting with “J”.
Annotating the class tree somewhat more, you finally get the full picture shown in Figure 11-7.
java.lang. Object
Other AWT Classes
(Font, Dimension, LayoutManager...)
Also used by Swing
java.awt. Component
AWT Components
java.awt. Container
java.awt.Window
java.awt.Panel
javax.swing. JComponent
java.awt.Frame
java.awt.Dialog
java.awt.Applet
javax.swing.JPanel
Swing Components
javax.swing.JWindow
javax.swing.JFrame
javax.swing.JDialog
javax.swing.JApplet
Heavyweight Swing Classes
Swing Containers
AWT Containers
figure 11-7  
comparing layout managers
Now that you have a clear picture of the GUI class hierarchy, you are ready to move on to the next
topic. Some of the general AWT classes that are reused in Swing represent layout managers. What is
a layout manager? Basically, an object specifying the way components in a container should be laid
out. Java offers a number of them out of the box, and you can combine these (by nesting containers
inside each other) to create relatively intricate layouts.
 
Search WWH ::




Custom Search