Class LabeledComponentGroup

java.lang.Object
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 Details

    • 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.
    • LabeledComponentGroup

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