Java Reference
In-Depth Information
properties: Equal Width and Num Columns . The first indicates whether the
columns in the grid are of equal width. The second determines the number of
columns. When figures are added to a grid layout, they are laid out in columns,
with new rows being added when this number is met.
Grid Layout Data elements have a number of properties, summarized in
Table 11-5.
Table 11-5
Grid Layout Properties
Property
Values
Description
Grab Excess
true | false
Determines whether the cell should be widened
Horizontal Space
to fit the remaining space. Default is false.
Grab Excess
true | false
Determines whether the cell should be made tall
Vertical Space
enough to fit the remaining space. Default is
false.
Horizontal
BEGINNING |
Determines how a figure is positioned
Alignment
CENTER | END |
horizontally within a cell. Default is CENTER.
FILL
Note that in horizontal alignment,
BEGINNING is LEFT and END is RIGHT.
FILL resizes the figure.
Horizontal Indent
Integer
Specifies the number of pixels of indentation on
the left side of the cell. Default is 0.
Horizontal Span
Integer
Specifies the number of column cells that the
figure will occupy. Default is 1.
Vertical Alignment
BEGINNING |
Determines how a figure is positioned vertically
CENTER | END |
within a cell. Default is CENTER. Note that in
FILL
vertical alignment, BEGINNING is TOP and
END is BOTTOM. FILL resizes the figure.
Vertical Span
Integer
Determines the number of row cells that the fig-
ure will occupy. Default is 1.
Figure 11-6 is an example of using Grid Layout to arrange figures within
a rectangle.
In this example, four figures are arranged using grid data elements within a
rectangle that uses grid layout settings equal width = true , number of
columns = 2 , as follows:
The hollow circle uses horizontal and vertical alignment of END , with hor-
izontal span = 2 . As you can see, it's situated at the bottom right of the
top row.
 
Search WWH ::




Custom Search