Package com.explodingpixels.macwidgets
Class LabeledComponentGroup
- java.lang.Object
-
- com.explodingpixels.macwidgets.LabeledComponentGroup
-
public class LabeledComponentGroup extends java.lang.Object
Creates a group of components and provides a label underneath those components. The added components will be placed side by side, with no spacing in between them, like this:
Here are a couple more practical applications ofLabledComponentGroup
:
Here's how to create aLabeledComponentGroup
with two buttons:JToggleButton leftButton = new JToggleButton("Left Button"); leftButton.putClientProperty("JButton.buttonType", "segmentedTextured"); leftButton.putClientProperty("JButton.segmentPosition", "first"); JToggleButton rightButton = new JToggleButton("Right Button"); rightButton.putClientProperty("JButton.buttonType", "segmentedTextured"); rightButton.putClientProperty("JButton.segmentPosition", "last"); LabeledComponentGroup group = new LabeledComponentGroup("Group", leftButton, rightButton);
-
-
Constructor Summary
Constructors Constructor Description LabeledComponentGroup(java.lang.String labelString, java.util.List<javax.swing.JComponent> components)
Creates a labeled component group using the given label and components.LabeledComponentGroup(java.lang.String labelString, javax.swing.ButtonGroup group)
Creates a labeled component group using the given button group.LabeledComponentGroup(java.lang.String labelString, javax.swing.JComponent... components)
Creates a labeled component group using the given label and components.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.JComponent
getComponent()
protected void
init(java.lang.String labelString, java.util.List<javax.swing.JComponent> components)
-
-
-
Constructor Detail
-
LabeledComponentGroup
public LabeledComponentGroup(java.lang.String labelString, javax.swing.JComponent... components)
Creates a labeled component group using the given label and components.- Parameters:
labelString
- the label of the group.components
- the components in the group.
-
LabeledComponentGroup
public LabeledComponentGroup(java.lang.String labelString, java.util.List<javax.swing.JComponent> components)
Creates a labeled component group using the given label and components.- Parameters:
labelString
- the label of the group.components
- the components in the group.
-
LabeledComponentGroup
public LabeledComponentGroup(java.lang.String labelString, javax.swing.ButtonGroup group)
Creates a labeled component group using the given button group.- Parameters:
labelString
- the label of the group.components
- the components in the group.
-
-