- 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
@JavaBean(description="A component within a group of menu items which can be selected.") public class JRadioButtonMenuItem extends JMenuItem implements Accessible
ラジオ・ボタン・メニュー項目の実装です。JRadioButtonMenuItemはメニュー項目のグループの一部となるメニュー項目で、グループ内では項目を1つだけ選択できます。 選択された項目は、選択状態を表示します。 また、この結果、選択されていたほかの項目は選択解除状態に切り替わります。 ラジオ・ボタン・メニュー項目のグループの選択状態を制御するには、ButtonGroupオブジェクトを使用します。メニュー項目は構成可能であり、
Actionを使用してある程度制御できます。 メニュー項目でActionを使用することは、メニュー項目を直接構成するのと比べて多くの利点があります。 詳細は「ActionをサポートするSwingコンポーネント」を参照してください。さらに、Java チュートリアルのActionsの使用方法のセクションに詳細が説明されています。一部のメニューには、ラジオ・ボタン・メニュー項目を含む複数のボタン・グループを含めることができます。 この場合、1つのラジオ・ボタン・メニュー項目をクリックしてもメニューが閉じないと便利です。 このような動作は、クライアント
JComponent.putClientProperty(java.lang.Object, java.lang.Object)またはルック・アンド・フィールUIManager.put(java.lang.Object, java.lang.Object)プロパティ"RadioButtonMenuItem.doNotCloseOnMouseClick"によって制御できます。 デフォルト値はfalseです。 プロパティをtrueに設定すると、マウスでクリックしたときにメニューが閉じません。 クライアントプロパティーが設定されている場合は、その値が常に使用されます。それ以外の場合は、L&Fプロパティーが照会されます。 ノート: 一部のL&Fでは、このプロパティが無視されることがあります。 すべての組込みL&Fは、この動作を継承します。詳細と使用例については、『The Java Tutorial』のセクション「How to Use Menus」を参照してください。
警告: Swingはスレッドに対して安全ではありません。 詳細は、「Swing's Threading Policy」を参照してください。
警告: このクラスの直列化されたオブジェクトは、今後のSwingリリースと互換ではなくなる予定です。 現在の直列化のサポートは、短期間の格納や、同じバージョンのSwingを実行するアプリケーション間のRMIに適しています。 1.4以降、すべてのJavaBeans™用の長期間の格納サポートが
java.beansパッケージに追加されています。XMLEncoderを参照してください。- 導入されたバージョン:
- 1.2
- 関連項目:
ButtonGroup、直列化された形式
-
-
ネストされたクラスのサマリー
ネストされたクラス 修飾子と型 クラス 説明 protected classJRadioButtonMenuItem.AccessibleJRadioButtonMenuItemこのクラスはJRadioButtonMenuItemクラスのアクセシビリティ・サポートを実装しています。-
クラスjavax.swingで宣言されたネストされたクラス/インタフェース。JMenuItem
JMenuItem.AccessibleJMenuItem
-
クラスjavax.swingで宣言されたネストされたクラス/インタフェース。AbstractButton
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener
-
クラスjavax.swingで宣言されたネストされたクラス/インタフェース。JComponent
JComponent.AccessibleJComponent
-
クラスjava.awtで宣言されたネストされたクラス/インタフェース。コンテナ
Container.AccessibleAWTContainer
-
クラスjava.awtで宣言されたネストされたクラス/インタフェース。コンポーネント
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
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
クラスjava.awtで宣言されるフィールド。コンポーネント
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
インタフェースjava.awt.imageで宣言されたフィールド。ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
インタフェース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
-
-
コンストラクタのサマリー
コンストラクタ コンストラクタ 説明 JRadioButtonMenuItem()テキストおよびアイコンを指定しないでJRadioButtonMenuItemを作成します。JRadioButtonMenuItem(String text)テキストを指定してJRadioButtonMenuItemを作成します。JRadioButtonMenuItem(String text, boolean selected)ラジオ・ボタン・メニュー項目を、選択状態とテキストを指定して作成します。JRadioButtonMenuItem(String text, Icon icon)指定されたIconとテキストを使用して、ラジオ・ボタン・メニュー項目を作成します。JRadioButtonMenuItem(String text, Icon icon, boolean selected)ラジオ・ボタン・メニュー項目を、テキスト、イメージ、および選択状態を指定して作成します。JRadioButtonMenuItem(Action a)指定されたActionからプロパティを取得するラジオ・ボタン・メニュー項目を作成します。JRadioButtonMenuItem(Icon icon)アイコンを指定してJRadioButtonMenuItemを作成します。JRadioButtonMenuItem(Icon icon, boolean selected)ラジオ・ボタン・メニュー項目を、イメージおよび選択状態を指定し、テキストを指定しないで作成します。
-
メソッドのサマリー
すべてのメソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 AccessibleContextgetAccessibleContext()このJRadioButtonMenuItemに関連付けられたAccessibleContextを取得します。StringgetUIClassID()このコンポーネントをレンダリングするL&Fクラスの名前を返します。protected StringparamString()この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, 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, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition
-
クラスjavax.swingで宣言されたメソッド。JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, 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, isPaintingOrigin, 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で宣言されたメソッド。コンテナ
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, transferFocusDownCycle, validate, validateTree
-
クラスjava.awtで宣言されたメソッド。コンポーネント
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, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
コンストラクタの詳細
-
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の場合、初期状態でボタンが選択される。それ以外の場合、初期状態でボタンは選択されない
-
-
メソッドの詳細
-
getUIClassID
@BeanProperty(bound=false) public String getUIClassID()
このコンポーネントをレンダリングするL&Fクラスの名前を返します。- オーバーライド:
getUIClassID、クラスJMenuItem- 戻り値:
- 文字列「RadioButtonMenuItemUI」
- 関連項目:
JComponent.getUIClassID(),UIDefaults.getUI(javax.swing.JComponent)
-
paramString
protected String paramString()
このJRadioButtonMenuItemの文字列表現を返します。 このメソッドはデバッグ専用であり、返される文字列の内容および形式は実装によって異なる可能性があります。 返される文字列は空でもかまいませんが、nullにはできません。- オーバーライド:
paramString、クラスJMenuItem- 戻り値:
- この
JRadioButtonMenuItemの文字列表現
-
getAccessibleContext
@BeanProperty(bound=false) public AccessibleContext getAccessibleContext()
このJRadioButtonMenuItemに関連付けられたAccessibleContextを取得します。 JRadioButtonMenuItemの場合、AccessibleContextはAccessibleJRadioButtonMenuItemの形式を取ります。 必要に応じて新規のAccessibleJRadioButtonMenuItemインスタンスが作成されます。- 定義:
getAccessibleContext、インタフェースAccessible- オーバーライド:
getAccessibleContext、クラスJMenuItem- 戻り値:
- このJRadioButtonMenuItemのAccessibleContextとして機能するAccessibleJRadioButtonMenuItem
-
-