Java Reference
In-Depth Information
There are two types of Java programs—applications and applets. Up to this point, we have
created only application programs. Even the programs we've created that use GUI compo-
nents are application programs. Java applets are small applications that can be embedded in
an HTML page. In this chapter, you will learn how to create an applet. You will also learn
how to convert a GUI application to a Java applet. This chapter also shows you how to use
fonts, colors, and geometric shapes to enhance the output of your programs.
In Chapter 6, you learned how to use GUI components, such as JFrame , JLabel , JTextField ,
and JButton , to make your programs attractive and user-friendly. In this chapter, you will
learn about other commonly usedGUI components. The class JComponent is the superclass
of the classes used to create various GUI components. Figure 12-1 shows the inheritance
hierarchy of the GUI classes that you have used in previous chapters, plus the ones you will
encounter in this chapter. The package containing the definition of a particular class is also shown.
Object (java.lang)
Component (java.awt)
Container (java.awt)
Window (java.awt)
Frame (java.awt)
JFrame (javax.swing)
Panel (java.awt)
JApplet
(javax.swing)
Applet (java.applet)
JComponent (javax.swing)
Classes from the
package javax.swing
AbstractButton
JButton
JMenuItem
ToggleButton
JCheckBox
JMenu
JRadioButton
JComboBox
JLabel
JList
JMenuBar
JPanel
JTextComponent
JTextField
JTextArea
FIGURE 12-1 Inheritance hierarchy of GUI classes (classes shown in the dotted rectangle are from
the package javax.swing )
 
Search WWH ::




Custom Search