java.awt

Class CheckboxGroup

  • java.lang.Object
    • java.awt.CheckboxGroup
  • All Implemented Interfaces:
    java.io.Serializable
    public class CheckboxGroup extends java.lang.Object implements java.io.Serializable
    The CheckboxGroup class is used to group together a set of Checkbox buttons.

    Exactly one check box button in a CheckboxGroup can be in the "on" state at any given time. Pushing any button sets its state to "on" and forces any other button that is in the "on" state into the "off" state.

    The following code example produces a new check box group, with three check boxes:


     setLayout(new GridLayout(3, 1));
     CheckboxGroup cbg = new CheckboxGroup();
     add(new Checkbox("one", cbg, true));
     add(new Checkbox("two", cbg, false));
     add(new Checkbox("three", cbg, false));
     

    This image depicts the check box group created by this example:

    Shows three checkboxes, arranged vertically, labeled one, two, and three. Checkbox one is in the on state.

    Since:
    JDK1.0
    See Also:
    Checkbox, Serialized Form
    • Constructors 
      Constructor and Description
      Ordinary member indicator CheckboxGroup Reveal DetailHide Detail
      Creates a new instance of CheckboxGroup.
    • Methods 
      Modifier and Type Method and Description
      Ordinary member indicator getCurrent Reveal DetailHide Detail
      Deprecated. As of JDK version 1.1, replaced by getSelectedCheckbox().
      Ordinary member indicator getSelectedCheckbox Reveal DetailHide Detail
      Gets the current choice from this check box group.
      Ordinary member indicator setCurrent Reveal DetailHide Detail
      Deprecated. As of JDK version 1.1, replaced by setSelectedCheckbox(Checkbox).
      Ordinary member indicator setSelectedCheckbox Reveal DetailHide Detail
      Sets the currently selected check box in this group to be the specified check box.
      Overridden member indicator toString Reveal DetailHide Detail
      Returns a string representation of this check box group, including the value of its current selection.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
This document was created by Dulcet from the OpenJDK sources. Copyright © 1993, 2012 Oracle and/or its affiliates. All rights reserved.

SourceForge