The GridBagConstraints
class specifies constraints
for components that are laid out using the
GridBagLayout
class.
static public RELATIVE:Number
gridwidth
, gridheight
),
or that this component be placed next to the previously added
component (gridx
, gridy
).
static public REMAINDER:Number
static public NONE:Number
static public BOTH:Number
static public HORIZONTAL:Number
static public VERTICAL:Number
static public CENTER:Number
static public NORTH:Number
static public NORTHEAST:Number
static public EAST:Number
static public SOUTHEAST:Number
static public SOUTH:Number
static public SOUTHWEST:Number
static public WEST:Number
static public NORTHWEST:Number
public gridx:Number
gridx=0
.
The leading edge of a component's display area is its left edge for
a horizontal, left-to-right container and its right edge for a
horizontal, right-to-left container.
The value
RELATIVE
specifies that the component be placed
immediately following the component that was added to the container
just before this component was added.
The default value is RELATIVE
.
gridx
should be a non-negative value.
public gridy:Number
gridy=0
. The value
RELATIVE
specifies that the component be placed just
below the component that was added to the container just before
this component was added.
The default value is RELATIVE
.
gridy
should be a non-negative value.
public gridwidth:Number
Use REMAINDER
to specify that the component be the
last one in its row. Use RELATIVE
to specify that the
component be the next-to-last one in its row.
gridwidth
should be non-negative and the default
value is 1.
public gridheight:Number
Use REMAINDER
to specify that the component be the
last one in its column. Use RELATIVE
to specify that
the component be the next-to-last one in its column.
gridheight
should be a non-negative value and the
default value is 1.
public weightx:Number
The grid bag layout manager calculates the weight of a column to
be the maximum weightx
of all the components in a
column. If the resulting layout is smaller horizontally than the area
it needs to fill, the extra space is distributed to each column in
proportion to its weight. A column that has a weight of zero receives
no extra space.
If all the weights are zero, all the extra space appears between the grids of the cell and the left and right edges.
The default value of this field is 0
.
weightx
should be a non-negative value.
public weighty:Number
The grid bag layout manager calculates the weight of a row to be
the maximum weighty
of all the components in a row.
If the resulting layout is smaller vertically than the area it
needs to fill, the extra space is distributed to each row in
proportion to its weight. A row that has a weight of zero receives no
extra space.
If all the weights are zero, all the extra space appears between the grids of the cell and the top and bottom edges.
The default value of this field is 0
.
weighty
should be a non-negative value.
public anchor:Number
CENTER
.
public fill:Number
The following values are valid for fill
:
NONE
: Do not resize the component.
HORIZONTAL
: Make the component wide enough to fill
its display area horizontally, but do not change its height.
VERTICAL
: Make the component tall enough to fill its
display area vertically, but do not change its width.
BOTH
: Make the component fill its display area
entirely.
The default value is NONE
.
public insets:Insets
The default value is new Insets(0, 0, 0, 0)
.
public ipadx:Number
(ipadx * 2)
pixels.
The default value is 0
.
public ipady:Number
(ipady * 2)
pixels.
The default value is 0.