home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    

Java in a Nutshell

Previous Chapter 18
The java.awt Package

18.10 java.awt.Checkbox (JDK 1.0)

This class represents a GUI checkbox with a textual label. The Checkbox maintains a boolean state--whether it is checked or not. The checkbox may optionally be part of a CheckboxGroup which enforces "radio button" behavior.

public class Checkbox extends Component implements ItemSelectable {
    // Public Constructors
            public Checkbox();
            public Checkbox(String label);
        1.1 public Checkbox(String label, boolean state);
        1.1 public Checkbox(String label, boolean state, CheckboxGroup group);
            public Checkbox(String label, CheckboxGroup group, boolean state);
    // Public Instance Methods
        1.1 public synchronized void addItemListener(ItemListener l);  // From ItemSelectable
            public void addNotify();  // Overrides Component
            public CheckboxGroup getCheckboxGroup();
            public String getLabel();
        1.1 public Object[] getSelectedObjects();  // From ItemSelectable
            public boolean getState();
        1.1 public synchronized void removeItemListener(ItemListener l);  // From ItemSelectable
            public void setCheckboxGroup(CheckboxGroup g);
            public synchronized void setLabel(String label);
            public void setState(boolean state);
    // Protected Instance Methods
            protected String paramString();  // Overrides Component
        1.1 protected void processEvent(AWTEvent e);  // Overrides Component
        1.1 protected void processItemEvent(ItemEvent e);


Object->Component(ImageObserver, MenuContainer, Serializable)->Checkbox(ItemSelectable)

Passed To:

CheckboxGroup.setCurrent(), CheckboxGroup.setSelectedCheckbox(), Toolkit.createCheckbox()

Returned By:

CheckboxGroup.getCurrent(), CheckboxGroup.getSelectedCheckbox()

Previous Home Next
java.awt.CardLayout (JDK 1.0) Book Index java.awt.CheckboxGroup (JDK 1.0)

Java in a Nutshell Java Language Reference Java AWT Java Fundamental Classes Exploring Java