Components, Containers, and Layout Managers

Much that is involved in understanding GUI programming and toolkits is learning a set of names and definitions for things with which you are already familiar.

Anonymous teacher of a course in internet programming using Java


Here are informal, working, definitions of the terms in the title.
Component
A functional element of an applet window. For example,

Container
A Component that contain other Components.

Layout Manager
Software that controls the organization and size of Components in the applet window or a Container.

In the previous section we saw some simple applet layouts. Here is a detailed presentation of the "kiosk" layout.


Layout Managers


Working with Layout Managers requires two levels of understanding.

The Tutorial has a good discussion of the various layout managers. Here is a brief introduction to two of them.

Flow Layout

Border Layout

The AWT provides other useful Layout Managers.

CardLayout
Displays one Component at a time from a "deck" of components

GridLayout
Lays out components in a grid of rectangles of the same size

GridBagLayout
Lays out components in a grid of rectangles of different sizes. Uses complex rules with parameters that are user defined


URL: https://www.umsl.edu/~siegelj/newcourse/part4/cclm.htm
Copyright: Jerrold Siegel for The University of Missouri -St. Louis
Last modified on 09/24/2000 14:15:56