Hi
we want to know about the component and container classes in java.
Explain the component and container classes. ?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted May 1, 2012, 6:18 PM EDT
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.
Thanks