|
ProgramixGenericLib v5.0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.programix.gui.layout.AbstractTableLayout
com.programix.gui.layout.AnchorTableLayout
com.programix.gui.layout.FormLayout
public class FormLayout
Lays out the components in two (typically) columns, generally with the
label in the left column and the input component in the right column.
The default number of columns is two, but this can be changed
via setColumnCount(int).
Each column may be a different width and each row may be a different height.
See AnchorTableLayout for further details.
When a component is smaller than the cell space allotted, it will not
necessarily be stretched, but anchored within the space
(see AnchorPoint).
Components in the left column are (by default) anchored as specified
by AnchorPoint.EAST.
Components in the right column are (by default) anchored as specified
by AnchorPoint.WEST.
This LayoutManager is very useful for laying out a standard form.
Example: 
Could have been created from:
JPanel formPane = new JPanel(new FormLayout());
formPane.add(new JLabel("Last Name:"));
formPane.add(new JTextField(25));
formPane.add(new JLabel("First Name:"));
formPane.add(new JTextField(20));
formPane.add(new JLabel());
formPane.add(new JCheckBox("Active", true));
formPane.add(new JLabel("Date of Birth:"));
formPane.add(new JTextField(8));
JTextArea ta = new JTextArea(5, 10);
ta.setWrapStyleWord(true);
ta.setLineWrap(true);
JScrollPane sp = new JScrollPane(ta);
formPane.add(new JLabel("Notes:"), AnchorPoint.NORTHEAST);
formPane.add(sp, AnchorPoint.CENTER_FLEX_BOTH);
formPane.add(new JLabel("Age:"));
formPane.add(new JTextField(3));
formPane.add(new JLabel("Start Date:"));
formPane.add(new JTextField(8));
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.programix.gui.layout.AnchorTableLayout |
|---|
AnchorTableLayout.AnchorTableCellData |
| Nested classes/interfaces inherited from class com.programix.gui.layout.AbstractTableLayout |
|---|
AbstractTableLayout.CellData |
| Field Summary |
|---|
| Fields inherited from class com.programix.gui.layout.AbstractTableLayout |
|---|
anchorPoint, borderGap, colGap, columnCoordinator, DEFAULT_ANCHOR_POINT, DEFAULT_BORDER_GAP, DEFAULT_COL_GAP, DEFAULT_ROW_GAP, ignoreInvisibleComponents, rowGap |
| Constructor Summary | |
|---|---|
FormLayout()
Creates a standard two-column form layout. |
|
FormLayout(AnchorPoint anchorPoint)
Creates a standard two-column form layout. |
|
FormLayout(int borderGap)
Creates a standard two-column form layout. |
|
FormLayout(int borderGap,
AnchorPoint anchorPoint)
Creates a standard two-column form layout. |
|
FormLayout(int rowGap,
int colGap,
AnchorPoint anchorPoint)
Creates a standard two-column form layout. |
|
FormLayout(int rowGap,
int colGap,
int borderGap)
Creates a standard two-column form layout. |
|
FormLayout(int rowGap,
int colGap,
int borderGap,
AnchorPoint anchorPoint)
Creates a standard two-column form layout. |
|
| Method Summary | |
|---|---|
protected AbstractTableLayout.CellData |
createCellData(Container pane)
This implementation returns a an instance of AnchorTableLayout.AnchorTableCellData
with a default anchor for all columns of AnchorPoint.CENTER. |
| Methods inherited from class com.programix.gui.layout.AnchorTableLayout |
|---|
addLayoutComponent, getColumnAnchorPoint, getColumnCount, getColumnHeaderAnchorPoint, getLayoutAlignmentX, getLayoutAlignmentY, invalidateLayout, maximumLayoutSize, removeLayoutComponent, setColumnAnchorPoint, setColumnCount, setColumnHeaderAnchorPoint |
| Methods inherited from class com.programix.gui.layout.AbstractTableLayout |
|---|
addLayoutComponent, getAnchorPoint, getBorderGap, getColumnCoordinator, getColumnGap, getRowGap, isIgnoreInvisibleComponents, layoutContainer, minimumLayoutSize, preferredLayoutSize, setAnchorPoint, setBorderGap, setColumnCoordinator, setColumnGap, setIgnoreInvisibleComponents, setRowGap |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.awt.LayoutManager |
|---|
addLayoutComponent, layoutContainer, minimumLayoutSize, preferredLayoutSize |
| Constructor Detail |
|---|
public FormLayout(int rowGap,
int colGap,
int borderGap,
AnchorPoint anchorPoint)
rowGap - - space between rows.
See setRowGap.colGap - - space between columns.
See setColumnGap.borderGap - - space around the outside of the form.
See setBorderGap.anchorPoint - - region to anchor to when there is extra space
See setAnchorPoint.
public FormLayout(int rowGap,
int colGap,
int borderGap)
AbstractTableLayout.DEFAULT_ANCHOR_POINT.
rowGap - - space between rows.
See setRowGap.colGap - - space between columns.
See setColumnGap.borderGap - - space around the outside of the form.
See setBorderGap.
public FormLayout(int rowGap,
int colGap,
AnchorPoint anchorPoint)
AbstractTableLayout.DEFAULT_BORDER_GAP.
rowGap - - space between rows.
See setRowGap.colGap - - space between columns.
See setColumnGap.anchorPoint - - region to anchor to when there is extra space
See setAnchorPoint.public FormLayout(int borderGap)
AbstractTableLayout.DEFAULT_ROW_GAP.
Uses AbstractTableLayout.DEFAULT_COL_GAP.
Uses AbstractTableLayout.DEFAULT_ANCHOR_POINT.
borderGap - - space around the outside of the form.
See setBorderGap.
public FormLayout(int borderGap,
AnchorPoint anchorPoint)
AbstractTableLayout.DEFAULT_ROW_GAP.
Uses AbstractTableLayout.DEFAULT_COL_GAP.
borderGap - - space around the outside of the form.
See setBorderGap.anchorPoint - - region to anchor to when there is extra space
See setAnchorPoint.public FormLayout(AnchorPoint anchorPoint)
AbstractTableLayout.DEFAULT_ROW_GAP.
Uses AbstractTableLayout.DEFAULT_COL_GAP.
Uses AbstractTableLayout.DEFAULT_BORDER_GAP.
anchorPoint - - region to anchor to when there is extra space
See setAnchorPoint.public FormLayout()
AbstractTableLayout.DEFAULT_ROW_GAP.
Uses AbstractTableLayout.DEFAULT_COL_GAP.
Uses AbstractTableLayout.DEFAULT_BORDER_GAP.
Uses AbstractTableLayout.DEFAULT_ANCHOR_POINT.
| Method Detail |
|---|
protected AbstractTableLayout.CellData createCellData(Container pane)
AnchorTableLayoutAnchorTableLayout.AnchorTableCellData
with a default anchor for all columns of AnchorPoint.CENTER.
If this is appropriate for a subclass, then the subclass does not
need to override this method.
createCellData in class AnchorTableLayout
|
ProgramixGenericLib v5.0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||