Swing Component Hierarchy

Figure 11.5 shows the UML diagram of a few Swing components.

Figure 11.5. The class diagram of a sampling of Swing components.

Figure 11.5 shows that a majority of Swing components subclass javax.swing.JComponent. Subclasses of JComponent are called lightweight components because they do not use peer classes (unlike AWT components that subclass java.awt.Component but not JComponent). The most significant exceptions to this are JDialog and JFrame. These are Swing containers that represent free-standing windows—evident from the fact that they eventually subclass java.awt.Window.

Table 11.2 lists some of the common Swing ...

Get Borland® JBuilder™ Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.