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. ...