O'Reilly logo

Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams by Jamie Jaworski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

AWT Containers

Although Component contains many GUI-related subclasses, its Container subclass is used to define components that can contain other components, including another container. The Container class provides methods for adding, retrieving, displaying, counting, and removing the components that it contains.

The Container class also provides methods for working with layouts, which are used to control the layout of components within a container. Layouts and layout managers are discussed in Chapter 12. You should become familiar with the following methods:

  • add()— Used to add a component to the container (usually under the control of a layout class).

  • getComponent() and getComponentAt()— Obtain a reference to a component in the container. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required