Home Segments Top Top Previous Next

Appendix D:

The Swing Classes

This appendix shows how the JFrame, JApplet, JPanel, and other related classes fit together in the class hierarchy, and explains why there are other classes with similar names.

The diagram shows how the JFrame, JApplet, JComponent, and JPanel fit in a hierarchy that also contains the Frame, Applet, and Panel classes:

*-----------* 
| Component | 
*-----------* 
   ^ 
   |  extends  
*-----------*  
| Container |  
*-----------*  
   ^ ^ ^ 
   | | |extends 
   | | *---------------------------* 
   | | extends                     | 
   | *-------------*               | 
   |  extends      |               | 
*-----------*   *-----------*   *----------------------------* 
| Window    |   | Panel     |   | JComponent                 | 
*-----------*   *-----------*   *----------------------------* 
   ^               ^               ^           ^   ^ 
   | extends       | extends       | extends   |   | 
*-----------*   *-----------*   *-----------*  |   | 
| Frame     |   | Applet    |   | JPanel    |  |   | 
*-----------*   *-----------*   *-----------*  |   | 
   ^               ^                *------------* | 
   | extends       | extends        | JList      | |   ^   ^ 
*-----------*   *-----------*       *------------* |   |   | 
| JFrame    |   | JApplet   |           *------------* |   | 
*-----------*   *-----------*           | JLabel     | |   | 
                                        *------------* |   | 
                                            *------------* | 
                                            | JTextField | | 
                                            *------------* | 
                                                *------------* 
                                                | JButton    | 
                                                *------------*