All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.GridLayout
java.lang.Object
|
+----java.awt.GridLayout
- public class GridLayout
- extends Object
- implements LayoutManager, Serializable
A layout manager for a container that lays out grids.
-
GridLayout()
- Creates a grid layout with a default of one column per component,
in a single row.
-
GridLayout(int, int)
- Creates a grid layout with the specified rows and columns.
-
GridLayout(int, int, int, int)
- Creates a grid layout with the specified rows, columns,
horizontal gap, and vertical gap.
-
addLayoutComponent(String, Component)
- Adds the specified component with the specified name to the layout.
-
getColumns()
- Returns the number of columns in this layout.
-
getHgap()
- Returns the horizontal gap between components.
-
getRows()
- Returns the number of rows in this layout.
-
getVgap()
- Returns the vertical gap between components.
-
layoutContainer(Container)
-
Lays out the container in the specified panel.
-
minimumLayoutSize(Container)
- Returns the minimum dimensions needed to layout the components
contained in the specified panel.
-
preferredLayoutSize(Container)
-
Returns the preferred dimensions for this layout given the components
int the specified panel.
-
removeLayoutComponent(Component)
- Removes the specified component from the layout.
-
setColumns(int)
- Sets the number of columns in this layout.
-
setHgap(int)
- Sets the horizontal gap between components.
-
setRows(int)
- Sets the number of rows in this layout.
-
setVgap(int)
- Sets the vertical gap between components.
-
toString()
- Returns the String representation of this GridLayout's values.
GridLayout
method GridLayout() public
- Creates a grid layout with a default of one column per component,
in a single row.
GridLayout
method GridLayout(rows=int, -
cols=int) public
- Creates a grid layout with the specified rows and columns.
- Parameters:
- rows - the rows
- cols - the columns
GridLayout
method GridLayout(rows=int, -
cols=int, -
hgap=int, -
vgap=int) public
- Creates a grid layout with the specified rows, columns,
horizontal gap, and vertical gap.
- Parameters:
- rows - the rows; zero means 'any number.'
- cols - the columns; zero means 'any number.' Only one of 'rows'
and 'cols' can be zero, not both.
- hgap - the horizontal gap variable
- vgap - the vertical gap variable
- Throws: IllegalArgumentException
- If the rows and columns are invalid.
getRows
method getRows() returns int public
- Returns the number of rows in this layout.
setRows
method setRows(rows=int) public
- Sets the number of rows in this layout.
- Parameters:
- rows - number of rows in this layout
getColumns
method getColumns() returns int public
- Returns the number of columns in this layout.
setColumns
method setColumns(cols=int) public
- Sets the number of columns in this layout.
- Parameters:
- cols - number of columns in this layout
getHgap
method getHgap() returns int public
- Returns the horizontal gap between components.
setHgap
method setHgap(hgap=int) public
- Sets the horizontal gap between components.
- Parameters:
- hgap - the horizontal gap between components
getVgap
method getVgap() returns int public
- Returns the vertical gap between components.
setVgap
method setVgap(vgap=int) public
- Sets the vertical gap between components.
- Parameters:
- vgap - the vertical gap between components
addLayoutComponent
method addLayoutComponent(name=String, -
comp=Component) public
- Adds the specified component with the specified name to the layout.
- Parameters:
- name - the name of the component
- comp - the component to be added
removeLayoutComponent
method removeLayoutComponent(comp=Component) public
- Removes the specified component from the layout. Does not apply.
- Parameters:
- comp - the component to be removed
preferredLayoutSize
method preferredLayoutSize(parent=Container) returns Dimension public
- Returns the preferred dimensions for this layout given the components
int the specified panel.
- Parameters:
- parent - the component which needs to be laid out
- See Also:
- minimumLayoutSize
minimumLayoutSize
method minimumLayoutSize(parent=Container) returns Dimension public
- Returns the minimum dimensions needed to layout the components
contained in the specified panel.
- Parameters:
- parent - the component which needs to be laid out
- See Also:
- preferredLayoutSize
layoutContainer
method layoutContainer(parent=Container) public
- Lays out the container in the specified panel.
- Parameters:
- parent - the specified component being laid out
- See Also:
- Container
toString
method toString() returns String public
- Returns the String representation of this GridLayout's values.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index