Explain the component and container classes.The Component class is found under java.awt package. The container class is the subclass of Component class. All non-menu-related elements that comprise a graphical user interface are derived from the abstract class Component. The Component class defines a number of of methods for handling events, changing window bounds, controlling fonts and colors, and drawing components and their content.
A container is a component that can accommodate other components and also other containers. Containers provide the support for building complex hierarchical graphical user interface. Container provides the overloaded method add () to include components in the container.
|