public final class FieldLayoutBuilder
extends java.lang.Object
Example:
JPanel p = new JPanel(); FieldLayoutBuilder b = new FieldLayoutBuilder( p ); b.add( field(). label( new JLabel() ).withText( "User &name:" ). component( new JTextField() ). button( new JButton() ).withText( "&Browse..." ) ); b.add( field(). component( new JCheckBox() ).withCaption( "Remember pas&sword" ). addToContainer(). b.addVerticalSpring();
Modifier and Type | Class and Description |
---|---|
static class |
FieldLayoutBuilder.ButtonSetup |
static class |
FieldLayoutBuilder.ButtonTextSetup |
static class |
FieldLayoutBuilder.ComponentSetup |
static class |
FieldLayoutBuilder.ComponentTextSetup |
static class |
FieldLayoutBuilder.ComponentTextSetupWithButton |
static class |
FieldLayoutBuilder.FieldSetup |
static class |
FieldLayoutBuilder.HeaderSetup |
static class |
FieldLayoutBuilder.LabelSetup |
static class |
FieldLayoutBuilder.LabelTextSetup |
Constructor and Description |
---|
FieldLayoutBuilder(java.awt.Container container)
Creates a new FieldLayoutBuilder that will add components to the specified container.
|
Modifier and Type | Method and Description |
---|---|
void |
add(FieldLayoutBuilder.ComponentTextSetup c) |
void |
add(FieldLayoutBuilder.FieldSetup f) |
void |
addHintText(java.lang.String text) |
void |
addRow(java.awt.Component c) |
void |
addVerticalField(javax.swing.JLabel label, java.awt.Component c) |
void |
addVerticalField(javax.swing.JLabel label, java.awt.Component c, float componentVerticalWeight) |
void |
addVerticalField(java.lang.String labelText, java.awt.Component c) |
void |
addVerticalField(java.lang.String labelText, java.awt.Component c, float componentVerticalWeight) |
void |
addVerticalGap() |
void |
addVerticalSpring() |
FieldLayoutBuilder.LabelSetup |
field() |
FieldLayoutBuilder.HeaderSetup |
headerField() |
FieldLayoutBuilder.LabelSetup |
indentedField() |
void |
setAlignLabelsLeft(boolean alignLabelsLeft)
Sets whether to align labels to the left.
|
void |
setMinimumWidth(int width) |
void |
setStretchComponentsWithNoButton(boolean stretchComponents) |
public FieldLayoutBuilder(java.awt.Container container)
container
- a container to add components to. Must not be null.public void setAlignLabelsLeft(boolean alignLabelsLeft)
alignLabelsLeft
-public void setStretchComponentsWithNoButton(boolean stretchComponents)
public void setMinimumWidth(int width)
public FieldLayoutBuilder.LabelSetup field()
public FieldLayoutBuilder.LabelSetup indentedField()
public FieldLayoutBuilder.HeaderSetup headerField()
public void add(FieldLayoutBuilder.ComponentTextSetup c)
public void add(FieldLayoutBuilder.FieldSetup f)
public void addVerticalGap()
public void addRow(java.awt.Component c)
public void addHintText(java.lang.String text)
public void addVerticalField(javax.swing.JLabel label, java.awt.Component c)
public void addVerticalField(javax.swing.JLabel label, java.awt.Component c, float componentVerticalWeight)
public void addVerticalField(java.lang.String labelText, java.awt.Component c)
public void addVerticalField(java.lang.String labelText, java.awt.Component c, float componentVerticalWeight)
public void addVerticalSpring()