|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.forms.builder.AbstractFormBuilder
com.jgoodies.forms.builder.PanelBuilder
com.jgoodies.forms.builder.ButtonStackBuilder
public final class ButtonStackBuilder
A non-visual builder that assists you in building consistent button stacks
using the FormLayout
.
Example:
The following example builds a button stack with Close, Up and
Down, where Up and Down are related, and Close is not related
to the other buttons, which makes a wide gap for the unrelated and
a smaller gap for the related buttons.
private JPanel createCloseUpDownButtonStack( JButton close, JButton up, JButton down) { ButtonStackBuilder builder = new ButtonStackBuilder(); builder.addGridded(close); builder.addUnrelatedGap(); builder.addGridded(up); builder.addRelatedGap(); builder.addGridded(down); return builder.getPanel(); }
Constructor Summary | |
---|---|
ButtonStackBuilder()
Constructs an instance of ButtonStackBuilder on a default
JPanel . |
|
ButtonStackBuilder(javax.swing.JPanel panel)
Constructs an instance of ButtonStackBuilder on the given
panel. |
Method Summary | |
---|---|
void |
addButtons(javax.swing.JButton[] buttons)
Adds a sequence of related buttons separated by a default gap. |
void |
addFixed(javax.swing.JComponent component)
Adds a fixed size component. |
void |
addGlue()
Adds a glue that will be given the extra space, if this box is larger than its preferred size. |
void |
addGridded(javax.swing.JComponent component)
Adds a gridded component. |
void |
addGriddedNarrow(javax.swing.JComponent component)
Adds a gridded narrow component. |
void |
addRelatedGap()
Adds the standard gap for related components. |
void |
addStrut(ConstantSize size)
Adds a strut of a specified size. |
void |
addUnrelatedGap()
Adds the standard gap for unrelated components. |
Methods inherited from class com.jgoodies.forms.builder.PanelBuilder |
---|
add, addLabel, addLabel, addLabel, addLabel, addSeparator, addSeparator, addSeparator, addSeparator, addTitle, addTitle, addTitle, getPanel, setBorder, setDefaultDialogBorder |
Methods inherited from class com.jgoodies.forms.builder.AbstractFormBuilder |
---|
add, add, add, appendColumn, appendColumn, appendGlueColumn, appendGlueRow, appendRelatedComponentsGapColumn, appendRelatedComponentsGapRow, appendRow, appendRow, appendUnrelatedComponentsGapColumn, appendUnrelatedComponentsGapRow, getColumn, getColumnCount, getContainer, getLayout, getRow, getRowCount, isLeftToRight, nextColumn, nextColumn, nextLine, nextLine, nextRow, nextRow, setAlignment, setBounds, setColumn, setColumnSpan, setExtent, setHAlignment, setLeftToRight, setOrigin, setRow, setRowSpan, setVAlignment |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ButtonStackBuilder(javax.swing.JPanel panel)
ButtonStackBuilder
on the given
panel.
panel
- the layout containerpublic ButtonStackBuilder()
ButtonStackBuilder
on a default
JPanel
.
Method Detail |
---|
public void addButtons(javax.swing.JButton[] buttons)
buttons
- an array of buttons to addpublic void addFixed(javax.swing.JComponent component)
component
- the component to addpublic void addGridded(javax.swing.JComponent component)
component
- the component to addpublic void addGriddedNarrow(javax.swing.JComponent component)
component
- the component to addpublic void addGlue()
public void addRelatedGap()
public void addUnrelatedGap()
public void addStrut(ConstantSize size)
size
- a constant that describes the gap
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |