AWT Hierarchy

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
Historical topic: Java appletsModern web browsers do not run Java applets. The Applet API was deprecated for removal before Java 25 and was removed in Java 26. Treat applet examples on this page as historical object-oriented/GUI examples; for new desktop interfaces use Swing where appropriate or JavaFX/OpenJFX.
go to previous page   go to home page   go to next page

Answer:

Yes. Children of the same parent have their parent's characteristics in common, but each child has additional methods and instance variables.

AWT Hierarchy

The Java AWT (Abstract Windowing Toolkit) contains the fundamental classes used for constructing GUIs. The abstract Component class is the base class for the AWT. Many AWT classes are derived from it. These are the old AWT components that are no longer in use.

Some of the AWT classes derived from Component are Button, Canvas, and Container.

The diagram shows how the classes of the AWT and Swing fit together. Look it over to get an overview. Refer back to it occasionally as you read these notes.

class hierarchy including Swing

The JComponent class is derived from Container and is one of the base classes of Swing. The JFrame class is derived from the AWT Frame class. It is usually the main container for a GUI application.

The JApplet class is derived from the AWT Applet class and is used for legacy Swing applets.

QUESTION 10:

(Review:) What is a container class?