GridLayout.GridLayout

GridLayout.GridLayout

Class Overview | Class Members | This Package | All Packages

Syntax 1
public GridLayout()
Description
Creates a grid layout with a default of one column per component, in a single row.



Syntax 2
public GridLayout( int rows, int cols )
Parameters
rows
the rows, with the value zero meaning any number of rows.
cols
the columns, with the value zero meaning any number of columns.
Description
Creates a grid layout with the specified number of rows and columns. All components in the layout are given equal size.

One, but not both, of rows and cols can be zero, which means that any number of objects can be placed in a row or in a column.



Syntax 3
public GridLayout( int rows, int cols, int hgap, int vgap )
Parameters
rows
the rows, with the value zero meaning any number of rows.
cols
the columns, with the value zero meaning any number of columns.
hgap
the horizontal gap.
vgap
the vertical gap.
Description
Creates a grid layout with the specified number of rows and columns. All components in the layout are given equal size.

In addition, the horizontal and vertical gaps are set to the specified values. Horizontal gaps are placed at the left and right edges, and between each of the columns. Vertical gaps are placed at the top and bottom edges, and between each of the rows.

One, but not both, of rows and cols can be zero, which means that any number of objects can be placed in a row or in a column.

Exceptions
IllegalArgumentException if the of rows or cols is invalid.