public class BRadioButtonMenuItem extends BMenuItem
RadioButtonGroup
. Each BRadioButtonMenuItem represents a single option. Choosing it from the menu
selects it, and deselects all other members of its RadioButtonGroup.
In addition to the event types generated by all Widgets, BRadioButtonMenuItems generate the following event types:
Constructor and Description |
---|
BRadioButtonMenuItem(RadioButtonGroup group)
Create a new BRadioButtonMenuItem with no label, which is initially deselected.
|
BRadioButtonMenuItem(java.lang.String text,
boolean state,
RadioButtonGroup group)
Create a new BRadioButtonMenuItem.
|
BRadioButtonMenuItem(java.lang.String text,
javax.swing.Icon image,
boolean state,
RadioButtonGroup group)
Create a new BRadioButtonMenuItem.
|
BRadioButtonMenuItem(java.lang.String text,
Shortcut shortcut,
boolean state,
RadioButtonGroup group)
Create a new BRadioButtonMenuItem.
|
BRadioButtonMenuItem(java.lang.String text,
Shortcut shortcut,
javax.swing.Icon image,
boolean state,
RadioButtonGroup group)
Create a new BRadioButtonMenuItem.
|
Modifier and Type | Method and Description |
---|---|
javax.swing.JRadioButtonMenuItem |
getComponent()
Get the java.awt.Component corresponding to this Widget.
|
RadioButtonGroup |
getGroup()
Get the RadioButtonGroup this menu item is part of.
|
boolean |
getState()
Get the selection state of this menu item.
|
void |
setGroup(RadioButtonGroup newGroup)
Set the RadioButtonGroup this menu item is part of.
|
void |
setState(boolean selected)
Set the selection state of this menu item.
|
getActionCommand, getIcon, getMnemonic, getShortcut, getText, setActionCommand, setIcon, setMnemonic, setShortcut, setText
addEventLink, dispatchEvent, getBackground, getBounds, getCursor, getFont, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible
addEventLink, addEventLink, removeEventLink
public BRadioButtonMenuItem(RadioButtonGroup group)
group
- the RadioButtonGroup this menu item is part ofpublic BRadioButtonMenuItem(java.lang.String text, boolean state, RadioButtonGroup group)
text
- the text to display on the BRadioButtonMenuItemstate
- the initial selection state of the BRadioButtonMenuItemgroup
- the RadioButtonGroup this menu item is part ofpublic BRadioButtonMenuItem(java.lang.String text, javax.swing.Icon image, boolean state, RadioButtonGroup group)
text
- the text to display on the BRadioButtonMenuItemimage
- the image to display next to the menu itemstate
- the initial selection state of the BRadioButtonMenuItemgroup
- the RadioButtonGroup this menu item is part ofpublic BRadioButtonMenuItem(java.lang.String text, Shortcut shortcut, boolean state, RadioButtonGroup group)
text
- the text to display on the BRadioButtonMenuItemshortcut
- a keyboard shortcut which will activate this menu itemstate
- the initial selection state of the BRadioButtonMenuItemgroup
- the RadioButtonGroup this menu item is part ofpublic BRadioButtonMenuItem(java.lang.String text, Shortcut shortcut, javax.swing.Icon image, boolean state, RadioButtonGroup group)
text
- the text to display on the BRadioButtonMenuItemshortcut
- a keyboard shortcut which will activate this menu itemimage
- the image to display next to the menu itemstate
- the initial selection state of the BRadioButtonMenuItemgroup
- the RadioButtonGroup this menu item is part ofpublic javax.swing.JRadioButtonMenuItem getComponent()
Widget
getComponent
in class BMenuItem
public boolean getState()
public void setState(boolean selected)
public RadioButtonGroup getGroup()
public void setGroup(RadioButtonGroup newGroup)
Written by Peter Eastman.