Java Reference
In-Depth Information
LISTING 7.22
continued
DISPLAY
By default, there are no horizontal and vertical gaps between the grid cells. The
gap sizes can be specified using an overloaded constructor or with the appropriate
GridLayout methods.
Box Layout
A box layout organizes components either vertically or horizontally, in one row
or one column, as shown in Figure 7.10. It is easy to use, yet when combined with
other box layouts, it can produce complex GUI designs similar to those that can be
accomplished with a GridBagLayout , which in general is far more difficult to master.
When a BoxLayout object is created, we specify that it will follow either the X
axis (horizontal) or the Y axis (vertical), using constants defined in the BoxLayout
class. Unlike other layout managers, the constructor of a BoxLayout takes as its
 
Search WWH ::




Custom Search