|
Modifier and Type |
Method and Description |
|
addLayoutComponent |
void addLayoutComponent(java.lang.String name,
Component comp)
Adds the specified component with the specified name to the layout.
public void addLayoutComponent(java.lang.String name,
Component comp)
-
Adds the specified component with the specified name to the layout.
- Specified by:
addLayoutComponent in interface LayoutManager
- Parameters:
name - the name of the componentcomp - the component to be added
|
|
getColumns |
int getColumns()
Gets the number of columns in this layout.
public int getColumns()
-
Gets the number of columns in this layout.
- Returns:
- the number of columns in this layout
- Since:
- JDK1.1
|
|
getHgap |
int getHgap()
Gets the horizontal gap between components.
public int getHgap()
-
Gets the horizontal gap between components.
- Returns:
- the horizontal gap between components
- Since:
- JDK1.1
|
|
getRows |
int getRows()
Gets the number of rows in this layout.
public int getRows()
-
Gets the number of rows in this layout.
- Returns:
- the number of rows in this layout
- Since:
- JDK1.1
|
|
getVgap |
int getVgap()
Gets the vertical gap between components.
public int getVgap()
-
Gets the vertical gap between components.
- Returns:
- the vertical gap between components
- Since:
- JDK1.1
|
|
layoutContainer |
void layoutContainer(Container parent)
Lays out the specified container using this layout.
public void layoutContainer( Container parent)
-
Lays out the specified container using this layout.
This method reshapes the components in the specified target
container in order to satisfy the constraints of the
GridLayout object.
The grid layout manager determines the size of individual
components by dividing the free space in the container into
equal-sized portions according to the number of rows and columns
in the layout. The container's free space equals the container's
size minus any insets and any specified horizontal or vertical
gap. All components in a grid layout are given the same size.
- Specified by:
layoutContainer in interface LayoutManager
- Parameters:
parent - the container in which to do the layout- See Also:
Container ,
Container.doLayout()
|
|
minimumLayoutSize |
Dimension minimumLayoutSize(Container parent)
Determines the minimum size of the container argument using this
grid layout.
-
Determines the minimum size of the container argument using this
grid layout.
The minimum width of a grid layout is the largest minimum width
of all of the components in the container times the number of columns,
plus the horizontal padding times the number of columns minus one,
plus the left and right insets of the target container.
The minimum height of a grid layout is the largest minimum height
of all of the components in the container times the number of rows,
plus the vertical padding times the number of rows minus one, plus
the top and bottom insets of the target container.
- Specified by:
minimumLayoutSize in interface LayoutManager
- Parameters:
parent - the container in which to do the layout
- Returns:
- the minimum dimensions needed to lay out the
subcomponents of the specified container
- See Also:
preferredLayoutSize(java.awt.Container) ,
Container.doLayout()
|
|
preferredLayoutSize |
Dimension preferredLayoutSize(Container parent)
Determines the preferred size of the container argument using
this grid layout.
-
Determines the preferred size of the container argument using
this grid layout.
The preferred width of a grid layout is the largest preferred
width of all of the components in the container times the number of
columns, plus the horizontal padding times the number of columns
minus one, plus the left and right insets of the target container.
The preferred height of a grid layout is the largest preferred
height of all of the components in the container times the number of
rows, plus the vertical padding times the number of rows minus one,
plus the top and bottom insets of the target container.
- Specified by:
preferredLayoutSize in interface LayoutManager
- Parameters:
parent - the container in which to do the layout
- Returns:
- the preferred dimensions to lay out the
subcomponents of the specified container
- See Also:
minimumLayoutSize(java.awt.Container) ,
Container.getPreferredSize()
|
|
removeLayoutComponent |
void removeLayoutComponent(Component comp)
Removes the specified component from the layout.
|
|
setColumns |
void setColumns(int cols)
Sets the number of columns in this layout to the specified value.
public void setColumns(int cols)
-
Sets the number of columns in this layout to the specified value.
Setting the number of columns has no affect on the layout
if the number of rows specified by a constructor or by
the setRows method is non-zero. In that case, the number
of columns displayed in the layout is determined by the total
number of components and the number of rows specified.
- Parameters:
cols - the number of columns in this layout
- Throws:
java.lang.IllegalArgumentException - if the value of both
rows and cols is set to zero- Since:
- JDK1.1
|
|
setHgap |
void setHgap(int hgap)
Sets the horizontal gap between components to the specified value.
public void setHgap(int hgap)
-
Sets the horizontal gap between components to the specified value.
- Parameters:
hgap - the horizontal gap between components- Since:
- JDK1.1
|
|
setRows |
void setRows(int rows)
Sets the number of rows in this layout to the specified value.
public void setRows(int rows)
-
Sets the number of rows in this layout to the specified value.
- Parameters:
rows - the number of rows in this layout
- Throws:
java.lang.IllegalArgumentException - if the value of both
rows and cols is set to zero- Since:
- JDK1.1
|
|
setVgap |
void setVgap(int vgap)
Sets the vertical gap between components to the specified value.
public void setVgap(int vgap)
-
Sets the vertical gap between components to the specified value.
- Parameters:
vgap - the vertical gap between components- Since:
- JDK1.1
|
|
toString |
java.lang.String toString()
Returns the string representation of this grid layout's values.
public java.lang.String toString()
-
Returns the string representation of this grid layout's values.
- Overrides:
toString in class java.lang.Object
- Returns:
- a string representation of this grid layout
|