Class Overview
A layout manager for a container that lays out grids. Allows setting
the relative sizes of rows and columns.
Summary
Public Constructors |
|
VariableGridLayout(int rows, int cols)
Creates a grid layout with the specified rows and specified columns.
|
|
VariableGridLayout(int rows, int cols, int hgap, int vgap)
Creates a grid layout with the specified rows, columns,
horizontal gap, and vertical gap.
|
[Expand]
Inherited Methods |
From class
java.awt.GridLayout
void
|
addLayoutComponent(String name, Component comp)
Adds the specified component with the specified name to the layout.
|
int
|
getColumns()
Gets the number of columns in this layout.
|
int
|
getHgap()
Gets the horizontal gap between components.
|
int
|
getRows()
Gets the number of rows in this layout.
|
int
|
getVgap()
Gets the vertical gap between components.
|
void
|
layoutContainer(Container parent)
Lays out the specified container using this layout.
|
Dimension
|
minimumLayoutSize(Container parent)
Determines the minimum size of the container argument using this
grid layout.
|
Dimension
|
preferredLayoutSize(Container parent)
Determines the preferred size of the container argument using
this grid layout.
|
void
|
removeLayoutComponent(Component comp)
Removes the specified component from the layout.
|
void
|
setColumns(int cols)
Sets the number of columns in this layout to the specified value.
|
void
|
setHgap(int hgap)
Sets the horizontal gap between components to the specified value.
|
void
|
setRows(int rows)
Sets the number of rows in this layout to the specified value.
|
void
|
setVgap(int vgap)
Sets the vertical gap between components to the specified value.
|
String
|
toString()
Returns the string representation of this grid layout's values.
|
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
From interface
java.awt.LayoutManager
|
Public Constructors
public
VariableGridLayout
(int rows, int cols)
Creates a grid layout with the specified rows and specified columns.
Parameters
rows
| the rows |
cols
| the columns
|
public
VariableGridLayout
(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 |
cols
| the columns |
hgap
| the horizontal gap variable |
vgap
| the vertical gap variable |
Public Methods
public
double
getColFraction
(int colNum)
public
double
getRowFraction
(int rowNum)
public
void
layoutContainer
(Container parent)
Lays out the container in the specified panel.
Parameters
parent
| the specified component being laid out |
public
void
setColFraction
(int colNum, double fraction)
public
void
setRowFraction
(int rowNum, double fraction)
public
String
toString
()
Returns the String representation of this VariableGridLayout's values.
Returns
- a string representation of this grid layout