Typical components include such items as buttons, scrollbars, and text fields. Components allow the user to interact with the program and provide the user with visual feedback about the state of the program. In the AWT, all user interface components are instances of class Component or one of its subtypes. Components do not stand alone, but rather are found within containers. Containers contain and control the layout of components.
Containers are themselves components, and can thus be placed inside other containers.
In the AWT, all containers are instances of class Container or one of its subtypes. Spatially, components must fit completely within the container that contains them. The illustration in Figure 1 depicts a simple graphical user interface as it would look when displayed under Windows 95. Figure 2 shows the interface components from Figure 1 arranged as a tree. A simple graphical user interface Figure 2.