JavaTM Platform
Standard Ed. 6

javax.swing
�� JCheckBoxMenuItem

java.lang.Object
  �̳��� java.awt.Component
      �̳��� java.awt.Container
          �̳��� javax.swing.JComponent
              �̳��� javax.swing.AbstractButton
                  �̳��� javax.swing.JMenuItem
                      �̳��� javax.swing.JCheckBoxMenuItem
������ʵ�ֵĽӿڣ�
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, MenuElement, SwingConstants

public class JCheckBoxMenuItem
extends JMenuItem
implements SwingConstants, Accessible

���Ա�ѡ����ȡ��ѡ���IJ˵�������ѡ�����˵�����Ա�ͨ�������һ����ѡ��ǡ����δ��ѡ����ȡ��ѡ�����˵�����Ա߾�û�и�ѡ��ǡ��񳣹�˵���һ������ѡ��˵����������֮�������ı���ͼ�꣬���߶��߼����֮��

isSelected/setSelected �� getState/setState ����������ȷ��/ָ���˵����ѡ��״̬����ѡ������ isSelected �� setSelected�����ǿ��������в˵��Ͱ�ť��getState �� setState ��������������������ļ����ԡ�

ͨ�� Action �����ð�ť��������ij�̶ֳȵĿ��ơ��� Action ���ڲ˵����������ֱ�����ò˵������������ŵ㡣�йظ�����ϸ��Ϣ�������֧�� Action �� Swing ��������� The Java Tutorial �е� How to Use Actions һ���ҵ�������Ϣ��

�й�ʹ�ø�ѡ��˵���ĸ�����Ϣ��ʾ��������� The Java Tutorial �е� How to Use Menus һ�ڡ�

���棺 Swing �����̰߳�ȫ�ġ��йظ�����Ϣ������� Swing's Threading Policy��

���棺��������л��������Ժ�� Swing �汾�����ݡ���ǰ���л�֧�������ڶ��ڴ洢������������������ͬ Swing �汾��Ӧ�ó���֮����� RMI��Remote Method Invocation��Զ�̷������ã����� 1.4 �汾��ʼ������ java.beans ����������֧������ JavaBeansTM ���ڴ洢�Ĺ��ܡ���μ� XMLEncoder��


Ƕ����ժҪ
protected  class JCheckBoxMenuItem.AccessibleJCheckBoxMenuItem
          ����ʵ�ֶ� JCheckBoxMenuItem ��Ŀɷ�����֧�֡�
 
���� javax.swing.JMenuItem �̳е�Ƕ����/�ӿ�
JMenuItem.AccessibleJMenuItem
 
���� javax.swing.AbstractButton �̳е�Ƕ����/�ӿ�
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener
 
���� javax.swing.JComponent �̳е�Ƕ����/�ӿ�
JComponent.AccessibleJComponent
 
���� java.awt.Container �̳е�Ƕ����/�ӿ�
Container.AccessibleAWTContainer
 
���� java.awt.Component �̳е�Ƕ����/�ӿ�
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
�ֶ�ժҪ
 
���� javax.swing.AbstractButton �̳е��ֶ�
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
 
���� javax.swing.JComponent �̳е��ֶ�
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
���� java.awt.Component �̳е��ֶ�
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
�ӽӿ� javax.swing.SwingConstants �̳е��ֶ�
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
�ӽӿ� java.awt.image.ImageObserver �̳е��ֶ�
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
���췽��ժҪ
JCheckBoxMenuItem()
          ����һ��û�������ı���ͼ��ġ����δѡ���ĸ�ѡ��˵��
JCheckBoxMenuItem(Action a)
          ����һ�������ṩ�� Action �л�ȡ�����ԵIJ˵��
JCheckBoxMenuItem(Icon icon)
          ������һ����ͼ��ġ����δ��ѡ���ĸ�ѡ��˵��
JCheckBoxMenuItem(String text)
          ����һ�����ı��ġ����δ��ѡ���ĸ�ѡ��˵��
JCheckBoxMenuItem(String text, boolean b)
          ��������ָ���ı���ѡ��״̬�ĸ�ѡ��˵��
JCheckBoxMenuItem(String text, Icon icon)
          ��������ָ���ı���ͼ��ġ����δ��ѡ���ĸ�ѡ��˵��
JCheckBoxMenuItem(String text, Icon icon, boolean b)
          ��������ָ���ı���ͼ���ѡ��״̬�ĸ�ѡ��˵��
 
����ժҪ
 AccessibleContext getAccessibleContext()
          ������ JCheckBoxMenuItem ������ AccessibleContext��
 Object[] getSelectedObjects()
          ���ذ�����ѡ��˵����ǩ������ (length 1)�����û��ѡ����ѡ���򷵻� null��
 boolean getState()
          ���ز˵����ѡ��״̬��
 String getUIClassID()
          ���س��ִ������ L&F ������ơ�
protected  String paramString()
          ���ش� JCheckBoxMenuItem ���ַ�����ʾ��ʽ��
 void setState(boolean b)
          ���ø����ѡ��״̬��
 
���� javax.swing.JMenuItem �̳еķ���
actionPropertyChanged, addMenuDragMouseListener, addMenuKeyListener, configurePropertiesFromAction, fireMenuDragMouseDragged, fireMenuDragMouseEntered, fireMenuDragMouseExited, fireMenuDragMouseReleased, fireMenuKeyPressed, fireMenuKeyReleased, fireMenuKeyTyped, getAccelerator, getComponent, getMenuDragMouseListeners, getMenuKeyListeners, getSubElements, init, isArmed, menuSelectionChanged, processKeyEvent, processMenuDragMouseEvent, processMenuKeyEvent, processMouseEvent, removeMenuDragMouseListener, removeMenuKeyListener, setAccelerator, setArmed, setEnabled, setModel, setUI, updateUI
 
���� javax.swing.AbstractButton �̳еķ���
addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, removeNotify, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition
 
���� javax.swing.JComponent �̳еķ���
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
���� java.awt.Container �̳еķ���
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
���� java.awt.Component �̳еķ���
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
���� java.lang.Object �̳еķ���
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

���췽����ϸ��Ϣ

JCheckBoxMenuItem

public JCheckBoxMenuItem()
����һ��û�������ı���ͼ��ġ����δѡ���ĸ�ѡ��˵��


JCheckBoxMenuItem

public JCheckBoxMenuItem(Icon icon)
������һ����ͼ��ġ����δ��ѡ���ĸ�ѡ��˵��

������
icon - CheckBoxMenuItem ��ͼ�ꡣ

JCheckBoxMenuItem

public JCheckBoxMenuItem(String text)
����һ�����ı��ġ����δ��ѡ���ĸ�ѡ��˵��

������
text - CheckBoxMenuItem ���ı�

JCheckBoxMenuItem

public JCheckBoxMenuItem(Action a)
����һ�������ṩ�� Action �л�ȡ�����ԵIJ˵��

�����°汾��ʼ��
1.3

JCheckBoxMenuItem

public JCheckBoxMenuItem(String text,
                         Icon icon)
��������ָ���ı���ͼ��ġ����δ��ѡ���ĸ�ѡ��˵��

������
text - CheckBoxMenuItem ���ı�
icon - CheckBoxMenuItem ��ͼ��

JCheckBoxMenuItem

public JCheckBoxMenuItem(String text,
                         boolean b)
��������ָ���ı���ѡ��״̬�ĸ�ѡ��˵��

������
text - ��ѡ��˵�����ı�
b - ��ѡ��˵����ѡ��״̬

JCheckBoxMenuItem

public JCheckBoxMenuItem(String text,
                         Icon icon,
                         boolean b)
��������ָ���ı���ͼ���ѡ��״̬�ĸ�ѡ��˵��

������
text - ��ѡ��˵�����ı�
icon - ��ѡ��˵����ͼ��
b - ��ѡ��˵����ѡ��״̬
������ϸ��Ϣ

getUIClassID

public String getUIClassID()
���س��ִ������ L&F ������ơ�

���ǣ�
�� JMenuItem �е� getUIClassID
���أ�
"CheckBoxMenuItemUI"
������
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

getState

public boolean getState()
���ز˵����ѡ��״̬���˷��������� AWT �����ԡ��´���Ӧ��ʹ�� isSelected() ��

���أ�
������ѡ�����򷵻� true

setState

public void setState(boolean b)
���ø����ѡ��״̬���˷��������� AWT �����ԡ��´���Ӧ��ʹ�� setSelected() ��

������
b - ָʾ����ѡ��״̬�� boolean ֵ������ true = ѡ��

getSelectedObjects

public Object[] getSelectedObjects()
���ذ�����ѡ��˵����ǩ������ (length 1)�����û��ѡ����ѡ���򷵻� null��

ָ���ߣ�
�ӿ� ItemSelectable �е� getSelectedObjects
���ǣ�
�� AbstractButton �е� getSelectedObjects
���أ�
������ѡ�����򷵻ذ���һ�� Object���˵�����ı��������飬���򷵻� null

paramString

protected String paramString()
���ش� JCheckBoxMenuItem ���ַ�����ʾ��ʽ���˷������ڽ��е���ʱʹ�ã����ڸ���ʵ�֣��������ַ��������ݺ͸�ʽ����������ͬ�����ص��ַ�������Ϊ�գ���������Ϊ null��

���ǣ�
�� JMenuItem �е� paramString
���أ�
�� JCheckBoxMenuItem ���ַ�����ʾ��ʽ��

getAccessibleContext

public AccessibleContext getAccessibleContext()
������ JCheckBoxMenuItem ������ AccessibleContext������ JCheckBoxMenuItems��AccessibleContext ���� AccessibleJCheckBoxMenuItem ����ʽ�����б�Ҫ���ɴ���һ���µ� AccessibleJCheckBoxMenuItem ʵ����

ָ���ߣ�
�ӿ� Accessible �е� getAccessibleContext
���ǣ�
�� JMenuItem �е� getAccessibleContext
���أ�
һ�� AccessibleJCheckBoxMenuItem�����䵱�� AccessibleJCheckBoxMenuItem �� AccessibleContext

JavaTM Platform
Standard Ed. 6

�ύ��������
�йظ���� API �ο����ϺͿ�����Ա�ĵ�������� Java SE ������Ա�ĵ������ĵ���������ϸ�ġ����򿪷���Ա���������Լ�������������ﶨ�塢ʹ�ü��ɺ͹�������ʾ����

��Ȩ���� 2007 Sun Microsystems, Inc. ��������Ȩ���� ����������֤��������������ĵ����·ַ�������