JavaTM Platform
Standard Ed. 6

javax.swing
クラス JRadioButtonMenuItem

java.lang.Object
  上位を拡張 java.awt.Component
      上位を拡張 java.awt.Container
          上位を拡張 javax.swing.JComponent
              上位を拡張 javax.swing.AbstractButton
                  上位を拡張 javax.swing.JMenuItem
                      上位を拡張 javax.swing.JRadioButtonMenuItem
すべての実装されたインタフェース:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, MenuElement, SwingConstants

public class JRadioButtonMenuItem
extends JMenuItem
implements Accessible

ラジオボタンメニュー項目の実装です。JRadioButtonMenuItem はメニュー項目のグループの一部となるメニュー項目で、グループ内では項目を 1 つだけ選択できます。選択された項目は、選択状態を表示します。また、この結果、選択されていたほかの項目は選択解除状態に切り替わります。ラジオボタンメニュー項目のグループの選択状態を制御するには、ButtonGroup オブジェクトを使用します。

メニュー項目は構成可能で、Action を使ってある程度まで制御できます。メニュー項目に対して 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 に適しています。JDK Version 1.4 以降、すべての JavaBeans の長期間の運用サポートは、java.beans パッケージに追加されています。詳細は、XMLEncoder を参照してください。

関連項目:
ButtonGroup

入れ子のクラスの概要
protected  class JRadioButtonMenuItem.AccessibleJRadioButtonMenuItem
          このクラスは JRadioButtonMenuItem クラス用のアクセシビリティーサポートを実装しています。
 
クラス 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
 
コンストラクタの概要
JRadioButtonMenuItem()
          テキストおよびアイコンを指定しないで JRadioButtonMenuItem を作成します。
JRadioButtonMenuItem(Action a)
          指定された Action からプロパティーを取得するラジオボタンメニュー項目を作成します。
JRadioButtonMenuItem(Icon icon)
          アイコンを指定して JRadioButtonMenuItem を作成します。
JRadioButtonMenuItem(Icon icon, boolean selected)
          ラジオボタンメニュー項目を、イメージおよび選択状態を指定し、テキストを指定しないで作成します。
JRadioButtonMenuItem(String text)
          テキストを指定して JRadioButtonMenuItem を作成します。
JRadioButtonMenuItem(String text, boolean selected)
          ラジオボタンメニュー項目を、選択状態とテキストを指定して作成します。
JRadioButtonMenuItem(String text, Icon icon)
          ラジオボタンメニュー項目を、Icon とテキストを指定して作成します。
JRadioButtonMenuItem(String text, Icon icon, boolean selected)
          ラジオボタンメニュー項目を、テキスト、イメージ、および選択状態を指定して作成します。
 
メソッドの概要
 AccessibleContext getAccessibleContext()
          この JRadioButtonMenuItem に関連した AccessibleContext を返します。
 String getUIClassID()
          このコンポーネントを描画する L&F クラスの名前を返します。
protected  String paramString()
          この JRadioButtonMenuItem の文字列表現を返します。
 
クラス 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, getSelectedObjects, 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
 

コンストラクタの詳細

JRadioButtonMenuItem

public JRadioButtonMenuItem()
テキストおよびアイコンを指定しないで JRadioButtonMenuItem を作成します。


JRadioButtonMenuItem

public JRadioButtonMenuItem(Icon icon)
アイコンを指定して JRadioButtonMenuItem を作成します。

パラメータ:
icon - JRadioButtonMenuItem に表示する Icon

JRadioButtonMenuItem

public JRadioButtonMenuItem(String text)
テキストを指定して JRadioButtonMenuItem を作成します。

パラメータ:
text - JRadioButtonMenuItem のテキスト

JRadioButtonMenuItem

public JRadioButtonMenuItem(Action a)
指定された Action からプロパティーを取得するラジオボタンメニュー項目を作成します。

パラメータ:
a - ラジオボタンメニュー項目のベースとなる Action
導入されたバージョン:
1.3

JRadioButtonMenuItem

public JRadioButtonMenuItem(String text,
                            Icon icon)
ラジオボタンメニュー項目を、Icon とテキストを指定して作成します。

パラメータ:
text - JRadioButtonMenuItem のテキスト
icon - JRadioButtonMenuItem に表示するアイコン

JRadioButtonMenuItem

public JRadioButtonMenuItem(String text,
                            boolean selected)
ラジオボタンメニュー項目を、選択状態とテキストを指定して作成します。

パラメータ:
text - CheckBoxMenuItem のテキスト
selected - CheckBoxMenuItem の選択状態

JRadioButtonMenuItem

public JRadioButtonMenuItem(Icon icon,
                            boolean selected)
ラジオボタンメニュー項目を、イメージおよび選択状態を指定し、テキストを指定しないで作成します。

パラメータ:
icon - ボタンで表示するイメージ
selected - true の場合、初期状態でボタンが選択される。 そうでない場合、初期状態でボタンは選択されない

JRadioButtonMenuItem

public JRadioButtonMenuItem(String text,
                            Icon icon,
                            boolean selected)
ラジオボタンメニュー項目を、テキスト、イメージ、および選択状態を指定して作成します。ほかのすべてのコンストラクタはこのコンストラクタに集約されます。

パラメータ:
text - ラジオボタンに表示する文字列
icon - ボタンで表示するイメージ
メソッドの詳細

getUIClassID

public String getUIClassID()
このコンポーネントを描画する L&F クラスの名前を返します。

オーバーライド:
クラス JMenuItem 内の getUIClassID
戻り値:
文字列 「RadioButtonMenuItemUI」
関連項目:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

paramString

protected String paramString()
この JRadioButtonMenuItem の文字列表現を返します。このメソッドはデバッグ専用であり、返される文字列の内容および形式は実装によって異なります。返される文字列は空の場合がありますが、null にはなりません。

オーバーライド:
クラス JMenuItem 内の paramString
戻り値:
この JRadioButtonMenuItem の文字列表現

getAccessibleContext

public AccessibleContext getAccessibleContext()
この JRadioButtonMenuItem に関連した AccessibleContext を返します。JRadioButtonMenuItem の場合、AccessibleContext は AccessibleJRadioButtonMenuItem の形式を取ります。必要に応じて新規の AccessibleJRadioButtonMenuItem インスタンスが作成されます。

定義:
インタフェース Accessible 内の getAccessibleContext
オーバーライド:
クラス JMenuItem 内の getAccessibleContext
戻り値:
この JRadioButtonMenuItem の AccessibleContext として 機能する AccessibleJRadioButtonMenuItem

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。