public class JMenuItem extends AbstractButton
| Modifier and Type | Field and Description |
|---|---|
protected Dimension |
_size |
_actionListeners, _itemListeners_border_alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description |
|---|
JMenuItem()
Create a menu item without text.
|
JMenuItem(java.lang.String text_)
Create a menu item with the specified text.
|
JMenuItem(java.lang.String text_,
int mnemonic_)
Create a menu item with the specified text and the specified
mnemonic.
|
| Modifier and Type | Method and Description |
|---|---|
void |
debug(int level_)
Outputs a textual description of this component to stderr.
|
void |
draw()
Draws the border of the component (if there is one).
|
int |
getHeight() |
Dimension |
getSize() |
int |
getWidth() |
Dimension |
minimumSize() |
void |
requestFocus()
This method should be invoked by all subclasses of Component
which override this method; because this method generates the
FOCUS_GAINED event when the component gains the keyboard focus.
|
java.lang.String |
toString() |
addActionListener, addItemListener, addKeyListenerToAncestor, doClick, fireActionPerformed, fireItemStateChanged, getActionCommand, getLabel, getLabelString, getMnemonic, getText, isSelected, keyPressed, keyReleased, keyTyped, processEvent, processMouseEvent, removeItemListener, setActionCommand, setLabel, setMnemonic, setParent, setSelected, setTextgetBorder, getInsets, setBorderaddFocusListener, addKeyListener, contains, contains, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getLocation, getLocationOnScreen, getName, getParent, hasFocus, hide, invalidate, isDisplayed, isEnabled, isFocusTraversable, isRecursivelyVisible, isTotallyObscured, isValid, isVisible, processFocusEvent, processKeyEvent, repaint, requestSync, setBackground, setBounds, setBounds, setBounds, setEnabled, setForeground, setLocation, setLocation, setName, setVisible, show, validate, validateCursesColorprotected Dimension _size
public JMenuItem()
public JMenuItem(java.lang.String text_)
public JMenuItem(java.lang.String text_,
int mnemonic_)
text_ - the label to be displayed in this menu item.mnemonic_ - an ASCII character. The first occurrence of
this character in the text label will be shown underlined; and
pressing this key will invoke the menu item.public void draw()
JComponentdraw in class JComponentpublic Dimension minimumSize()
minimumSize in class Componentpublic void requestFocus()
ComponentrequestFocus in class Componentpublic void debug(int level_)
public java.lang.String toString()
toString in class java.lang.Object