public class TableLayout extends Object implements Layout
Container
's components
according to a tabular grid with a fixed number of columns. This is similar
to Java's GridLayout
, but the cells in the grid may have
different dimensions.Constructor and Description |
---|
TableLayout(int cols)
Initializes a layout manager object with the specified number of columns
and no gap between the components.
|
TableLayout(int cols,
double gapH,
double gapV)
Initializes a layout manager object with the specified number of columns
and the distances between the components.
|
Modifier and Type | Method and Description |
---|---|
int |
getColumns()
Returns the number of desired columns.
|
Dimension2D |
getGap()
Returns the minimal space between components.
|
Dimension2D |
getPreferredSize(Container container)
Returns the preferred size of the specified container using this layout.
|
void |
layout(Container container)
Arranges the components of the specified container according to this
layout.
|
public TableLayout(int cols, double gapH, double gapV)
cols
- Number of columnsgapH
- Horizontal gap.gapV
- Vertical gap.public TableLayout(int cols)
cols
- Number of columns.public void layout(Container container)
public Dimension2D getPreferredSize(Container container)
getPreferredSize
in interface Layout
container
- Container whose preferred size is to be returned.public Dimension2D getGap()
public int getColumns()
Copyright © 2009-2013. All Rights Reserved.