Java Reference
In-Depth Information
example, to have the same width. The width of JButton instances is initially determined by the
text on the button—each button is made just wide enough to display its text. Inserting buttons into a
GridLayout will result in all buttons being resized to the width of the widest button. If an odd num-
ber of equal-size components cannot fill a 2D grid, there may be spare space in some configurations.
Figure 11.8
A BoxLayout lays out multiple components either vertically or horizontally. The components are
not resized, and the layout will not wrap components when resized (Figure 11.9). By nesting multi-
ple BoxLayouts inside each other, sophisticated two-dimensionally aligned layouts may be built.
Figure 11.9
Search WWH ::

Custom Search