public final class ButtonBarBuilder extends AbstractButtonPanelBuilder
FormLayout and honors the platform'
LayoutStyle regarding button sizes, and gaps.Examples:
ButtonStackBuilder,
LayoutStylefocusGroupedcurrentCellConstraints| Constructor and Description |
|---|
ButtonBarBuilder()
Constructs an empty ButtonBarBuilder on a JPanel.
|
ButtonBarBuilder(JPanel panel)
Constructs an empty ButtonBarBuilder on the given panel.
|
| Modifier and Type | Method and Description |
|---|---|
ButtonBarBuilder |
addButton(Action... actions)
Constructs an array of JButtons from the given Action array
and adds them as a sequence of related buttons separated by a default gap.
|
ButtonBarBuilder |
addButton(JComponent... buttons)
Adds one or many sequences of related buttons.
|
ButtonBarBuilder |
addButton(JComponent button)
Adds a button component that has a minimum widt
specified by the
LayoutStyle.getDefaultButtonWidth(). |
ButtonBarBuilder |
addFixed(JComponent component)
Adds a fixed size component with narrow margin.
|
ButtonBarBuilder |
addGlue()
Adds a glue that will be given the extra space
if this button bar is larger than its preferred size.
|
ButtonBarBuilder |
addGrowing(JComponent component)
Adds a component that grows if the container grows.
|
ButtonBarBuilder |
addRelatedGap()
Adds the standard horizontal gap for related components.
|
ButtonBarBuilder |
addStrut(ConstantSize width)
Adds a horizontal strut of the specified width.
|
ButtonBarBuilder |
addUnrelatedGap()
Adds the standard horizontal gap for unrelated components.
|
ButtonBarBuilder |
background(Color background)
Sets the panel's background color and makes the panel opaque.
|
ButtonBarBuilder |
border(Border border)
Sets the panel's border.
|
static ButtonBarBuilder |
create() |
ButtonBarBuilder |
opaque(boolean b)
Sets the panel's opaque state.
|
add, appendColumn, appendGlueColumn, appendGlueRow, appendRelatedComponentsGapColumn, appendRelatedComponentsGapRow, appendRow, appendUnrelatedComponentsGapColumn, appendUnrelatedComponentsGapRow, build, createButton, getColumn, getPanel, getRow, isLeftToRight, nextColumn, nextRow, setBackground, setBorder, setLeftToRight, setOpaquecreateComponentFactory, getColumnCount, getComponentFactory, getContainer, getLayout, getRowCount, setComponentFactorypublic ButtonBarBuilder()
public ButtonBarBuilder(JPanel panel)
panel - the layout containerpublic static ButtonBarBuilder create()
public ButtonBarBuilder addButton(JComponent button)
LayoutStyle.getDefaultButtonWidth().
addButton in class AbstractButtonPanelBuilderbutton - the component to addNullPointerException - if button is nullpublic ButtonBarBuilder addButton(JComponent... buttons)
AbstractButtonPanelBuildernull. The next sequence is separated by a
unrelated gap
Each button has the minimum width as specified b
LayoutStyle.getDefaultButtonWidth(). The gap width betwee
the buttons is LayoutStyle.getRelatedComponentsPadX().Examples:
addButton in class AbstractButtonPanelBuilderbuttons - the buttons to addAbstractButtonPanelBuilder.addButton(JComponent)public ButtonBarBuilder addButton(Action... actions)
AbstractButtonPanelBuilderaddButton in class AbstractButtonPanelBuilderactions - an array of buttons to addpublic ButtonBarBuilder addFixed(JComponent component)
component - the component to addpublic ButtonBarBuilder addGrowing(JComponent component)
LayoutStyle.getDefaultButtonWidth().component - the component to addpublic ButtonBarBuilder addGlue()
public ButtonBarBuilder addRelatedGap()
addRelatedGap in class AbstractButtonPanelBuilderLayoutStyle.getRelatedComponentsPadX()public ButtonBarBuilder addUnrelatedGap()
addUnrelatedGap in class AbstractButtonPanelBuilderLayoutStyle.getUnrelatedComponentsPadX()public ButtonBarBuilder addStrut(ConstantSize width)
addRelatedGap()addUnrelatedGap() respectively.width - describes the gap widthColumnSpec.createGap(ConstantSize)public ButtonBarBuilder background(Color background)
AbstractButtonPanelBuilderbackground in class AbstractButtonPanelBuilderbackground - the color to set as new backgroundJComponent.setBackground(Color)public ButtonBarBuilder border(Border border)
AbstractButtonPanelBuilderborder in class AbstractButtonPanelBuilderborder - the border to setJComponent.setBorder(Border)public ButtonBarBuilder opaque(boolean b)
AbstractButtonPanelBuilderopaque in class AbstractButtonPanelBuilderb - true for opaque, false for non-opaqueJComponent.setOpaque(boolean)Copyright © 2002-2014 JGoodies Software GmbH. All Rights Reserved.