Components and Containers

In Java, you organize components as nested elements. Typically you have a frame, which contains several panels and maybe a toolbar and a menubar. In fact, each panel can contain other components such as text fields and labels or even other panels, so a complete graphical user interface can consist of many nested elements. The JFC and AWT containers are components themselves and can be contained in other containers. You can see this in their class diagrams, which also show their points of similarity.

Design Patterns

AWT and JFC use the design patterns Publish and Subscribe, Observer/Observable, Decorator, and Strategy, among others. These are described in Design Patterns (Gamma et al., 1995)—a must read for a deep understanding ...

Get Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.