What Is Component and Container in Java

Java 8Object Oriented ProgrammingProgramming. The class Component is the abstract base class for the non-menu user-interface controls of AWT. A component represents an object with graphical representation. The class Container is the superclass for the containers of AWT.

What is difference between container and component?

containercomponentContainer is a window-like component that can contain other components.A component is an object, like a button or a scroll bar.

What is component and container in AWT?

Containers are integral part of AWT GUI components. A container provides a space where a component can be located. A Container in AWT is a component itself and it adds the capability to add component to itself. … A default layout is present in each container which can be overridden using setLayout method.

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest