com.explodingpixels.macwidgets
Class LabeledComponentGroup

java.lang.Object
  extended by com.explodingpixels.macwidgets.LabeledComponentGroup

public class LabeledComponentGroup
extends 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 of LabledComponentGroup:

    

Here's how to create a LabeledComponentGroup 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
LabeledComponentGroup(String labelString, JComponent... components)
          Creates a labeled component group using the given label and components.
LabeledComponentGroup(String labelString, List<JComponent> components)
          Creates a labeled component group using the given label and components.
 
Method Summary
 JComponent getComponent()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabeledComponentGroup

public LabeledComponentGroup(String labelString,
                             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(String labelString,
                             List<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.
Method Detail

getComponent

public JComponent getComponent()