Where Am I? Class Hierarchy (JFC) All Classes (JFC)

Class com.sun.java.swing.JCheckBox

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.AbstractButton
                                   |
                                   +----com.sun.java.swing.JToggleButton
                                           |
                                           +----com.sun.java.swing.JCheckBox

public class JCheckBox
extends JToggleButton
implements Accessible

An implementation of a CheckBox -- an item that can be selected or deselected, and which displays its state to the user. In a group of checkboxes, multiple checkboxes can be selected.

Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.

See Also:
JRadioButton

Constructor Index

JCheckBox()
Creates an initially unselected checkbox button with no text, no icon.
JCheckBox(Icon)
Creates an initially unselected checkbox with an icon.
JCheckBox(Icon, boolean)
Creates a checkbox with an icon and specifies whether or not it is initially selected.
JCheckBox(String)
Creates an initially unselected checkbox with text.
JCheckBox(String, boolean)
Creates a checkbox with text and specifies whether or not it is initially selected.
JCheckBox(String, Icon)
Creates an initially unselected checkbox with the specified text and icon.
JCheckBox(String, Icon, boolean)
Creates a checkbox with text and icon, and specifies whether or not it is initially selected.

Method Index

getAccessibleContext()
Get the AccessibleContext associated with this JComponent
getUIClassID()
Returns a string that specifies the name of the L&F class that renders this component.
updateUI()
Notification from the UIFactory that the L&F has changed.

Constructors

JCheckBox
 public JCheckBox()
Creates an initially unselected checkbox button with no text, no icon.

JCheckBox
 public JCheckBox(Icon icon)
Creates an initially unselected checkbox with an icon.

Parameters:
icon - the Icon image to display
JCheckBox
 public JCheckBox(Icon icon,
                  boolean selected)
Creates a checkbox with an icon and specifies whether or not it is initially selected.

Parameters:
icon - the Icon image to display
selected - a boolean value indicating the initial selection state. If true the checkbox is selected
JCheckBox
 public JCheckBox(String text)
Creates an initially unselected checkbox with text.

Parameters:
text - the text of the checkbox.
JCheckBox
 public JCheckBox(String text,
                  boolean selected)
Creates a checkbox with text and specifies whether or not it is initially selected.

Parameters:
text - the text of the checkbox.
selected - a boolean value indicating the initial selection state. If true the checkbox is selected
JCheckBox
 public JCheckBox(String text,
                  Icon icon)
Creates an initially unselected checkbox with the specified text and icon.

Parameters:
text - the text of the checkbox.
icon - the Icon image to display
JCheckBox
 public JCheckBox(String text,
                  Icon icon,
                  boolean selected)
Creates a checkbox with text and icon, and specifies whether or not it is initially selected.

Parameters:
text - the text of the checkbox.
icon - the Icon image to display
selected - a boolean value indicating the initial selection state. If true the checkbox is selected

Methods

updateUI
 public void updateUI()
Notification from the UIFactory that the L&F has changed.

Overrides:
updateUI in class JToggleButton
See Also:
updateUI
getUIClassID
 public String getUIClassID()
Returns a string that specifies the name of the L&F class that renders this component.

Returns:
"CheckBoxUI"
Overrides:
getUIClassID in class JToggleButton
See Also:
getUIClassID, getUI
getAccessibleContext
 public AccessibleContext getAccessibleContext()
Get the AccessibleContext associated with this JComponent

Returns:
the AccessibleContext of this JComponent
Overrides:
getAccessibleContext in class JToggleButton

Where Am I? Class Hierarchy (JFC) All Classes (JFC)