Home Segments Top Top Previous Next

967: Mainline

Generally, displays in which the components have fixed positions and dimensions look ugly when the size of the container grows or shrinks. Accordingly, if you anticipate that users will change a container's size, and if none of the layout managers offered in Java's API suit you, you are likely to want to define your own layout manager.

For example, you might want to define a layout manager for your movie application that divides the applet's graphical representation into a 3 by 3 grid:

*---------------*---------------*---------------* 
|               |               |               | 
|               |               |               | 
|     Meter     |     Image     |               | 
|               |               |               | 
|               |               |     List      | 
|               |               |               | 
*---------------*---------------*               | 
|                               |               | 
|             Form              |               | 
|                               |               | 
*-------------------------------*---------------*