Java Reference
In-Depth Information
Figure 3-27.
When a layout method is not specified, the JVM assumes BorderLayout. BorderLayout divides the frame into
5 areas (see Figure
3-28
).
Figure 3-28.
Locations are specified as North, East, and so on, and the default is Center. However, combining component
absolute locations (e.g., 100, 150) and a layout will yield unexpected results (Figure
3-27
). Therefore, programmers
must do one of the following:
A.
Accept the BorderLayout defaults
B.
Specify a layout
Specify layout as
null
and define an absolute location for each component.
C.