public class BCheckBoxMenuItem extends BMenuItem
In addition to the event types generated by all Widgets, BCheckBoxMenuItems generate the following event types:
Constructor and Description |
---|
BCheckBoxMenuItem()
Create a new BCheckBoxMenuItem with no label, which is initially deselected.
|
BCheckBoxMenuItem(java.lang.String text,
boolean state)
Create a new BCheckBoxMenuItem.
|
BCheckBoxMenuItem(java.lang.String text,
javax.swing.Icon image,
boolean state)
Create a new BCheckBoxMenuItem.
|
BCheckBoxMenuItem(java.lang.String text,
Shortcut shortcut,
boolean state)
Create a new BCheckBoxMenuItem.
|
BCheckBoxMenuItem(java.lang.String text,
Shortcut shortcut,
javax.swing.Icon image,
boolean state)
Create a new BCheckBoxMenuItem.
|
Modifier and Type | Method and Description |
---|---|
javax.swing.JMenuItem |
getComponent()
Get the java.awt.Component corresponding to this Widget.
|
boolean |
getState()
Get the selection state of this menu item.
|
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 BCheckBoxMenuItem()
public BCheckBoxMenuItem(java.lang.String text, boolean state)
text
- the text to display on the BCheckBoxMenuItemstate
- the initial selection state of the BCheckBoxMenuItempublic BCheckBoxMenuItem(java.lang.String text, javax.swing.Icon image, boolean state)
text
- the text to display on the BCheckBoxMenuItemimage
- the image to display next to the menu itemstate
- the initial selection state of the BCheckBoxMenuItempublic BCheckBoxMenuItem(java.lang.String text, Shortcut shortcut, boolean state)
text
- the text to display on the BCheckBoxMenuItemshortcut
- a keyboard shortcut which will activate this menu itemstate
- the initial selection state of the BCheckBoxMenuItempublic BCheckBoxMenuItem(java.lang.String text, Shortcut shortcut, javax.swing.Icon image, boolean state)
text
- the text to display on the BCheckBoxMenuItemshortcut
- a keyboard shortcut which will activate this menu itemimage
- the image to display next to the menu itemstate
- the initial selection state of the BCheckBoxMenuItempublic javax.swing.JMenuItem getComponent()
Widget
getComponent
in class BMenuItem
public boolean getState()
public void setState(boolean selected)
Written by Peter Eastman.