
 |
Chapter 19 java.awt Reference |
 |
GridLayout
Name
GridLayout
The GridLayout LayoutManager
provides the means to layout components in a grid of rows and columns.
- Description
-
Constructs a GridLayout object
with a default single row and one column per component.
- Parameters
-
- rows
-
Requested number of rows in container.
- cols
-
Requested number of columns in container.
- Description
-
Constructs a GridLayout object
with the requested number of rows and columns. Note that the actual number
of rows and columns depends on the number of objects in the layout, not
the constructor's parameters.
- Parameters
-
- rows
-
Requested number of rows in container.
- cols
-
Requested number of columns in container.
- hgap
-
Horizontal space between each component in a row.
- vgap
-
Vertical space between each row.
- Description
-
Constructs a GridLayout object
with the requested number of rows
and columns and the values
specified as the gaps between each component. Note that the actual number
of rows and columns depends on the number of objects in the layout, not
the constructor's parameters.
- Parameters
-
- name
-
Name of component to
add.
- component
-
Actual component
being added.
- Implements
-
LayoutManager.addLayoutComponent()
- Description
-
Does nothing.
- Returns
-
The number of columns.
- Returns
-
The horizontal gap for this GridLayout
instance.
- Returns
-
The number of rows.
- Returns
-
The vertical gap for this GridLayout
instance.
- Parameters
-
- target
-
The container that needs to be redrawn.
- Implements
-
LayoutManager.layoutContainer()
- Description
-
Draws the components contained within the target.
- Parameters
-
- target
-
The container whose
size needs to be calculated.
- Returns
-
Minimum Dimension of the container
target.
- Implements
-
LayoutManager.minimumLayoutSize()
- Description
-
Calculates the minimum size of the target
container.
- Parameters
-
- target
-
The container whose
size needs to be calculated.
- Returns
-
Preferred Dimension of the
container target.
- Implements
-
LayoutManager.preferredLayoutSize()
- Description
-
Calculates the preferred size of the target
container.
- Parameters
-
- component
-
Component to stop tracking.
- Implements
-
LayoutManager.removeLayoutComponent()
- Description
-
Does nothing.
- Parameters
-
- cols
-
The new number of columns.
- Description
-
Sets the number of columns.
- Parameters
-
- hgap
-
The horizontal gap value.
- Description
-
Sets the horizontal gap between components.
- Parameters
-
- rows
-
The new number of rows.
- Description
-
Sets the number of rows.
- Parameters
-
- vgap
-
The vertical gap value.
- Description
-
Sets the vertical gap between components.
- Returns
-
A string representation of the GridLayout
object.
- Overrides
-
Object.toString()
Component, Container,
Dimension, LayoutManager,
Object, String
|
|