June 2004
Intermediate to advanced
848 pages
21h 28m
English
Figure 22-5 shows a frame to which we have added several controls. They are positioned automatically as we add them.
Figure 22-5. Arranging controls on the screen

The code for this is on the CD in the directory containing all the other AWT programming material. The problem is the end result doesn't look very professional because nothing is neatly aligned. Solution: layout managers!
Layout Managers are classes that specify how components should be placed in a container. You choose a layout manager for a container with a call similar to the following invoked on the content pane:
setLayout( new FlowLayout() );
We'll look ...
Read now
Unlock full access