Components, Containers, and Layout Managers

Component and Container form a simple, yet fundamental, relationship of the AWT: containers may contain components. All containers come equipped with a layout manager,[2] which positions and shapes (lays out) the container's components. A layout manager's responsibilities are defined by the java.awt.LayoutManager and java.awt.LayoutManager2 interfaces. Much of the action that takes place in the AWT occurs between components, containers, and their layout managers.

[2] Except for the java.awt.Container class itself.

Components

In Java parlance, user interface controls, such as panels, scrollbars, labels, textfields, buttons, and so on are generically referred to as components because they all extend

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.