|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
java.awt.Component
![]()
![]()
![]()
java.awt.Container
![]()
![]()
![]()
javax.swing.JComponent
![]()
![]()
![]()
javax.swing.AbstractButton
![]()
![]()
![]()
javax.swing.JMenuItem
![]()
![]()
![]()
javax.swing.JCheckBoxMenuItem
, ItemSelectable
, MenuContainer
, Serializable
, Accessible
, MenuElement
, SwingConstants

public class JCheckBoxMenuItem

, Accessible

A menu item that can be selected or deselected. If selected, the menu item typically appears with a checkmark next to it. If unselected or deselected, the menu item appears without a checkmark. Like a regular menu item, a check box menu item can have either text or a graphic icon associated with it, or both.
Either isSelected/setSelected or
getState/setState can be used
to determine/specify the menu item's selection state. The
preferred methods are isSelected and
setSelected, which work for all menus and buttons.
The getState and setState methods exist for
compatibility with other component sets.
For further information and examples of using check box menu items, see How to Use Menus, a section in The Java Tutorial.
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 JavaBeansTM
has been added to the java.beans package.
Please see XMLEncoder
.
| Nested Class Summary | |
|---|---|
protected class |
JCheckBoxMenuItem.AccessibleJCheckBoxMenuItem
This class implements accessibility support for the JCheckBoxMenuItem class. |
Nested classes/interfaces inherited from class javax.swing.JMenuItem ![]() |
|---|
JMenuItem.AccessibleJMenuItem |
Nested classes/interfaces inherited from class javax.swing.AbstractButton ![]() |
|---|
AbstractButton.AccessibleAbstractButton |
Nested classes/interfaces inherited from class javax.swing.JComponent ![]() |
|---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container ![]() |
|---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component ![]() |
|---|
Component.AccessibleAWTComponent |
| Field Summary |
|---|
Fields inherited from class javax.swing.JComponent ![]() |
|---|
accessibleContext |
Fields inherited from class java.awt.Component ![]() |
|---|
BOTTOM_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants ![]() |
|---|
BOTTOM |
Fields inherited from interface java.awt.image.ImageObserver ![]() |
|---|
ABORT |
| Constructor Summary | |
|---|---|
JCheckBoxMenuItem
Creates an initially unselected check box menu item with no set text or icon. |
|
JCheckBoxMenuItem
Creates a menu item whose properties are taken from the Action supplied. |
|
JCheckBoxMenuItem
Creates an initially unselected check box menu item with an icon. |
|
JCheckBoxMenuItem
Creates an initially unselected check box menu item with text. |
|
JCheckBoxMenuItem
Creates a check box menu item with the specified text and selection state. |
|
JCheckBoxMenuItem
Creates an initially unselected check box menu item with the specified text and icon. |
|
JCheckBoxMenuItem
Creates a check box menu item with the specified text, icon, and selection state. |
|
| Method Summary | |
|---|---|
AccessibleContext |
getAccessibleContext
Gets the AccessibleContext associated with this JCheckBoxMenuItem. |
Object |
getSelectedObjects
Returns an array (length 1) containing the check box menu item label or null if the check box is not selected. |
boolean |
getState
Returns the selected-state of the item. |
String |
getUIClassID
Returns the name of the L&F class that renders this component. |
protected String |
paramString
Returns a string representation of this JCheckBoxMenuItem. |
void |
setState
Sets the selected-state of the item. |
Methods inherited from class javax.swing.AbstractButton ![]() |
|---|
addActionListener |