Buttons can be configured, and to some degree controlled, by
Actions. Using an
Action with a button has many benefits beyond directly
configuring a button. Refer to
Swing Components Supporting Action for more
details, and you can find more information in How
to Use Actions, a section in The Java Tutorial.
Warning
Swing is not thread safe. For more information see Swing's Threading Policy.
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 applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans package.
Please see java..
JRadioButton
| Modifier and Type | Class and Description |
|---|---|
| protected class | JCheckBox.
This class implements accessibility support for the
|
| Modifier and Type | Field and Description |
|---|---|
| public static final String | BORDER_PAINTED_FLAT_CHANGED_PROPERTY
Identifies a change to the flat property. |
| private boolean | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public AccessibleContext | Returns: an AccessibleJCheckBox that serves as the AccessibleContext of this JCheckBoxOverrides javax. Implements javax. Gets the AccessibleContext associated with this JCheckBox. |
| public String | Returns: the string "CheckBoxUI"Overrides javax. Returns a string that specifies the name of the L&F class that renders this component. |
| public boolean | Returns: the value of theborderPaintedFlat propertyGets the value of the |
| protected String | Returns: a string representation of this JCheckBox.Overrides javax. Returns a string representation of this JCheckBox. |
| private void | readObject(ObjectInputStream s)
Hides javax. See JComponent.readObject() for information about serialization in Swing. |
| public void | setBorderPaintedFlat(boolean
true requests that the border be painted flat;
false requests normal bordersSets the |
| pack-priv void | setIconFromAction(Action a)
Overrides javax. The icon for checkboxes comes from the look and feel, not the Action; this is overridden to do nothing. |
| public void | updateUI()
Overrides javax. Resets the UI property to a value from the current look and feel. |
| private void | writeObject(ObjectOutputStream s)
Hides javax. See readObject() and writeObject() in JComponent for more information about serialization in Swing. |
| BORDER_PAINTED_FLAT_CHANGED_PROPERTY | back to summary |
|---|---|
| public static final String BORDER_PAINTED_FLAT_CHANGED_PROPERTY Identifies a change to the flat property. | |
| flat | back to summary |
|---|---|
| private boolean flat | |
| uiClassID | back to summary |
|---|---|
| private static final String uiClassID Hides javax.
| |
| JCheckBox | back to summary |
|---|---|
| public JCheckBox() Creates an initially unselected check box button with no text, no icon. | |
| JCheckBox | back to summary |
|---|---|
| public JCheckBox(Icon icon) Creates an initially unselected check box with an icon.
| |
| JCheckBox | back to summary |
|---|---|
| public JCheckBox(Icon icon, boolean selected) Creates a check box with an icon and specifies whether or not it is initially selected.
| |
| JCheckBox | back to summary |
|---|---|
| public JCheckBox(String text) Creates an initially unselected check box with text.
| |
| JCheckBox | back to summary |
|---|---|
| public JCheckBox(Action a) Creates a check box where properties are taken from the Action supplied.
| |
| JCheckBox | back to summary |
|---|---|
| public JCheckBox(String text, boolean selected) Creates a check box with text and specifies whether or not it is initially selected.
| |
| JCheckBox | back to summary |
|---|---|
| public JCheckBox(String text, Icon icon) Creates an initially unselected check box with the specified text and icon. | |
| JCheckBox | back to summary |
|---|---|
| public JCheckBox(String text, Icon icon, boolean selected) Creates a check box with text and icon, and specifies whether or not it is initially selected. | |
| getAccessibleContext | back to summary |
|---|---|
| public AccessibleContext getAccessibleContext() Overrides javax. Implements javax. Gets the AccessibleContext associated with this JCheckBox. For JCheckBoxes, the AccessibleContext takes the form of an AccessibleJCheckBox. A new AccessibleJCheckBox instance is created if necessary.
| |
| getUIClassID | back to summary |
|---|---|
| public String getUIClassID() Overrides javax. Returns a string that specifies the name of the L&F class that renders this component.
| |
| isBorderPaintedFlat | back to summary |
|---|---|
| public boolean isBorderPaintedFlat() Gets the value of the
| |
| paramString | back to summary |
|---|---|
| protected String paramString() Overrides javax. Returns a string representation of this JCheckBox. This method
is intended to be used only for debugging purposes, and the
content and format of the returned string may vary between
implementations. The returned string may be empty but may not
be
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException Hides javax. See JComponent.readObject() for information about serialization in Swing.
| |
| setBorderPaintedFlat | back to summary |
|---|---|
| public void setBorderPaintedFlat(boolean b) Sets the
| |
| setIconFromAction | back to summary |
|---|---|
| pack-priv void setIconFromAction(Action a) Overrides javax. The icon for checkboxes comes from the look and feel, not the Action; this is overridden to do nothing. | |
| updateUI | back to summary |
|---|---|
| public void updateUI() Overrides javax. Resets the UI property to a value from the current look and feel.
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream s) throws IOException Hides javax. Doc from javax. See readObject() and writeObject() in JComponent for more information about serialization in Swing.
| |
JCheckBox class. It provides an implementation of the
Java Accessibility API appropriate to check box user-interface
elements.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 applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans package.
Please see java..
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public AccessibleRole | Returns: an instance of AccessibleRole describing the role of the objectOverrides javax. Get the role of this object. |
| AccessibleJCheckBox | back to summary |
|---|---|
| protected AccessibleJCheckBox() Constructs an | |
| getAccessibleRole | back to summary |
|---|---|
| public AccessibleRole getAccessibleRole() Overrides javax. Get the role of this object.
| |