java.awt
public class GridLayout extends Object implements LayoutManager, Serializable
Constructor Summary | |
---|---|
GridLayout() Create a new GridLayout with one row and any number
of columns. | |
GridLayout(int rows, int cols) Create a new GridLayout with the specified number
of rows and columns. | |
GridLayout(int rows, int cols, int hgap, int vgap) Create a new GridLayout with the specified number of rows and
columns and the specified gaps.
|
Method Summary | |
---|---|
void | addLayoutComponent(String name, Component comp) Add a new component to the layout. |
int | getColumns() Return the number of columns in this layout. |
int | getHgap() Return the horizontal gap. |
int | getRows() Return the number of rows in this layout. |
int | getVgap() Return the vertical gap. |
void | layoutContainer(Container parent) Lay out the container's components based on current settings.
|
Dimension | minimumLayoutSize(Container cont) Get the minimum layout size of the container. |
Dimension | preferredLayoutSize(Container cont) Get the preferred layout size of the container. |
void | removeLayoutComponent(Component comp) Remove the indicated component from this layout manager.
|
void | setColumns(int newCols) Set the number of columns. |
void | setHgap(int hgap) Set the horizontal gap. |
void | setRows(int newRows) Set the number of rows |
void | setVgap(int vgap) Set the vertical gap. |
String | toString() Return String description of this object. |
GridLayout
with one row and any number
of columns. Both gaps are set to 0.GridLayout
with the specified number
of rows and columns. Both gaps are set to 0. Note that the row
and column settings cannot both be zero. If both the row and
column values are non-zero, the rows value takes precedence.Parameters: rows Number of rows cols Number of columns
Throws: IllegalArgumentException If rows and columns are both 0, or if either are negative
Parameters: rows Number of rows cols Number of columns hgap The horizontal gap vgap The vertical gap
Throws: IllegalArgumentException If rows and columns are both 0, if either are negative, or if either gap is negative
Parameters: name The name of the component to add. comp The component to add.
Parameters: parent The container to lay out
Parameters: cont The parent container
Parameters: cont The parent container
Parameters: comp The component to remove
Parameters: newCols
Throws: IllegalArgumentException If the number of columns is negative, or if the number of columns is zero and the number of rows is already 0.
Parameters: hgap The horizontal gap
Parameters: newRows
Throws: IllegalArgumentException If the number of rows is negative, or if the number of rows is zero and the number of columns is already 0.
Parameters: vgap The vertical gap