Superclasses of Swing’s Lightweight GUI Components

The UML class diagram of Fig. 12.5 shows an inheritance hierarchy of classes from which lightweight Swing components inherit their common attributes and behaviors.

Image

Fig. 12.5 | Common superclasses of the lightweight Swing components.

Class Component (package java.awt) is a superclass that declares the common features of GUI components in packages java.awt and javax.swing. Any object that is a Container (package java.awt) can be used to organize Components by attaching the Components to the Container. Containers can be placed in other Containers to organize a GUI.

Class JComponent (package javax.swing ...

Get Java™ How To Program (Early Objects), Tenth Edition 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.