Class java.awt.GridLayout
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
A layout manager for a container that lays out grids.
- 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.
- 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.
- toString()
- Returns the String representation of this GridLayout's values.
GridLayout
public GridLayout(int rows,
int cols)
- Creates a grid layout with the specified rows and columns.
- Parameters:
- rows - the rows
- cols - the columns
GridLayout
public GridLayout(int rows,
int cols,
int hgap,
int vgap)
- 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.
addLayoutComponent
public void addLayoutComponent(String name,
Component comp)
- 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
public void removeLayoutComponent(Component comp)
- Removes the specified component from the layout. Does not apply.
- Parameters:
- comp - the component to be removed
preferredLayoutSize
public Dimension preferredLayoutSize(Container parent)
- 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
public Dimension minimumLayoutSize(Container parent)
- 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
public void layoutContainer(Container parent)
- Lays out the container in the specified panel.
- Parameters:
- parent - the specified component being laid out
- See Also:
- Container
toString
public String toString()
- Returns the String representation of this GridLayout's values.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index