Java プラットフォーム 1.2

javax.swing
クラス JRadioButtonMenuItem

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.AbstractButton
                          |
                          +--javax.swing.JMenuItem
                                |
                                +--javax.swing.JRadioButtonMenuItem

public class JRadioButtonMenuItem
extends JMenuItem
implements Accessible

RadioButtonMenuItem の実装です。RadioButtonMenuItem はメニュー項目のグループの一部となるメニュー項目で、グループ内では項目を 1 つだけ選択できます。選択された項目は、選択状態の表示に変わります。また、この結果、選択されていた他の項目は選択解除状態に切り替わります。

ButtonGroup オブジェクトと一緒に使うと、1 回に 1 つの項目だけを選択できる、メニュー項目のグループを作成できます。ButtonGroup オブジェクトを作成し、その add メソッドで、JRadioButtonMenuItem オブジェクト (複数) をグループに組み込みます。

標準の Look & Feel (L&F) 表現でこのコンポーネントが使用するキーボードのキーについては、JRadioButtonMenuItem のキーの割り当てを参照してください。

警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。

関連項目:
ButtonGroup, 直列化された形式

内部クラスの概要
protected  class JRadioButtonMenuItem.AccessibleJRadioButtonMenuItem
          オブジェクトのユーザ補助機能を取得するために使用するクラスです。
 
クラス javax.swing.JMenuItem から継承した内部クラス
JMenuItem.AccessibleJMenuItem
 
クラス javax.swing.AbstractButton から継承した内部クラス
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener
 
クラス javax.swing.JComponent から継承した内部クラス
JComponent.AccessibleJComponent
 
クラス 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
 
コンストラクタの概要
JRadioButtonMenuItem()
          テキストおよびアイコンの指定なしで JRadioButtonMenuItem を作成します。
JRadioButtonMenuItem(Icon icon)
          アイコンの指定ありで JRadioButtonMenuItem を作成します。
JRadioButtonMenuItem(Icon icon, boolean selected)
          ラジオボタンメニュー項目を、イメージおよび選択状態の指定あり、テキストの指定なしで作成します。
JRadioButtonMenuItem(String text)
          テキストの指定ありで JRadioButtonMenuItem を作成します。
JRadioButtonMenuItem(String text, boolean b)
          ラジオボタンメニュー項目を、テキストおよび選択状態の指定ありで作成します。
JRadioButtonMenuItem(String text, Icon icon)
          テキストおよびアイコンの指定ありで JRadioButtonMenuItem を作成します。
JRadioButtonMenuItem(String text, Icon icon, boolean selected)
          ラジオボタンメニュー項目を、テキスト、イメージ、および選択状態の指定ありで作成します。
 
メソッドの概要
 AccessibleContext getAccessibleContext()
          JComponent に関連付けられた AccessibleContext を取得します。
 String getUIClassID()
          コンポーネントを描画する L&F クラスの名前を返します。
protected  void init(String text, Icon icon)
          指定されたテキストとアイコンで、JRadioButtonMenuItem を初期化します。
protected  String paramString()
          この JRadioButtonMenuItem の文字列表現を返します。
 void requestFocus()
          フォーカスを取得しないように、Component.requestFocus() をオーバーライドします。
 void updateUI()
          L&F が変更されたことを示す UIFactory からの通知です。
 
クラス javax.swing.JMenuItem から継承したメソッド
addMenuDragMouseListener, addMenuKeyListener, fireMenuDragMouseDragged, fireMenuDragMouseEntered, fireMenuDragMouseExited, fireMenuDragMouseReleased, fireMenuKeyPressed, fireMenuKeyReleased, fireMenuKeyTyped, getAccelerator, getComponent, getSubElements, isArmed, menuSelectionChanged, processKeyEvent, processMenuDragMouseEvent, processMenuKeyEvent, processMouseEvent, removeMenuDragMouseListener, removeMenuKeyListener, setAccelerator, setArmed, setEnabled, setUI
 
クラス javax.swing.AbstractButton から継承したメソッド
addActionListener, addChangeListener, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getActionCommand, getDisabledIcon, getDisabledSelectedIcon, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getLabel, getMargin, getMnemonic, getModel, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setFocusPainted, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setLabel, setMargin, setMnemonic, setMnemonic, setModel, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition
 
クラス javax.swing.JComponent から継承したメソッド
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
クラス java.awt.Container から継承したメソッド
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
クラス java.awt.Component から継承したメソッド
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

JRadioButtonMenuItem

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

JRadioButtonMenuItem

public JRadioButtonMenuItem(Icon icon)
アイコンの指定ありで JRadioButtonMenuItem を作成します。
パラメータ:
icon - RadioButtonMenuItem に表示するアイコン

JRadioButtonMenuItem

public JRadioButtonMenuItem(String text)
テキストの指定ありで JRadioButtonMenuItem を作成します。
パラメータ:
text - RadioButtonMenuItem に表示するテキスト

JRadioButtonMenuItem

public JRadioButtonMenuItem(String text,
                            Icon icon)
テキストおよびアイコンの指定ありで JRadioButtonMenuItem を作成します。
パラメータ:
text - RadioButtonMenuItem に表示するテキスト
icon - RadioButtonMenuItem に表示するアイコン

JRadioButtonMenuItem

public JRadioButtonMenuItem(String text,
                            boolean b)
ラジオボタンメニュー項目を、テキストおよび選択状態の指定ありで作成します。
パラメータ:
text - CheckBoxMenuItem に表示するテキスト
b - checkboxmenuitem の選択状態

JRadioButtonMenuItem

public JRadioButtonMenuItem(Icon icon,
                            boolean selected)
ラジオボタンメニュー項目を、イメージおよび選択状態の指定あり、テキストの指定なしで作成します。
パラメータ:
icon - ボタンに表示するイメージ
selected - true の場合は、ボタンは初期状態で選択。そうでない場合は、初期状態ではボタンは選択解除

JRadioButtonMenuItem

public JRadioButtonMenuItem(String text,
                            Icon icon,
                            boolean selected)
ラジオボタンメニュー項目を、テキスト、イメージ、および選択状態の指定ありで作成します。
パラメータ:
text - ラジオボタンに表示する文字列
icon - ボタンに表示するイメージ
メソッドの詳細

init

protected void init(String text,
                    Icon icon)
指定されたテキストとアイコンで、JRadioButtonMenuItem を初期化します。
パラメータ:
text - 表示するテキスト
icon - 表示するアイコン
オーバーライド:
クラス JMenuItem 内の init

updateUI

public void updateUI()
L&F が変更されたことを示す UIFactory からの通知です。UI を UIFactory からの最新バージョンに置き換えるために呼び出されます。
オーバーライド:
クラス JMenuItem 内の updateUI
関連項目:
JComponent.updateUI()

getUIClassID

public String getUIClassID()
コンポーネントを描画する L&F クラスの名前を返します。
戻り値:
RadioButtonMenuItemUI
オーバーライド:
クラス JMenuItem 内の getUIClassID
関連項目:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

requestFocus

public void requestFocus()
フォーカスを取得しないように、Component.requestFocus() をオーバーライドします。
オーバーライド:
クラス JComponent 内の requestFocus

paramString

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

JFC コンポーネントの新しい側面についての情報を返すには、paramString() をオーバーライドします。

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

getAccessibleContext

public AccessibleContext getAccessibleContext()
JComponent に関連付けられた AccessibleContext を取得します。
定義:
インタフェース Accessible 内の getAccessibleContext
戻り値:
JComponent の AccessibleContext
オーバーライド:
クラス JMenuItem 内の getAccessibleContext

Java プラットフォーム 1.2

バグや機能要求の報告
新しい javadoc の表示についてのコメントやご提案
Java は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.