charvax.swing

Class JMenuItem

Implemented Interfaces:
EventListener, ItemSelectable, KeyListener
Known Direct Subclasses:
JMenu

public class JMenuItem
extends AbstractButton

An implementation of an item in a menu.

Field Summary

protected Dimension
_size

Fields inherited from class charvax.swing.AbstractButton

_actionListeners, _itemListeners

Fields inherited from class charvax.swing.JComponent

_border

Fields inherited from class charva.awt.Component

BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT, _alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible

Constructor Summary

JMenuItem()
Create a menu item without text.
JMenuItem(String text_)
Create a menu item with the specified text.
JMenuItem(String text_, int mnemonic_)
Create a menu item with the specified text and the specified mnemonic.

Method Summary

void
debug(int level_)
Outputs a textual description of this component to stderr.
void
draw()
int
getHeight()
Dimension
getSize()
int
getWidth()
Dimension
minimumSize()
void
requestFocus()
String
toString()

Methods inherited from class charvax.swing.AbstractButton

addActionListener, addItemListener, doClick, fireActionPerformed, fireItemStateChanged, getActionCommand, getLabel, getLabelString, getMnemonic, getText, isSelected, keyPressed, keyReleased, keyTyped, processEvent, processMouseEvent, removeItemListener, setActionCommand, setLabel, setMnemonic, setSelected, setText

Methods inherited from class charvax.swing.JComponent

draw, getBorder, getInsets, setBorder

Methods inherited from class charva.awt.Component

addFocusListener, addKeyListener, contains, contains, debug, draw, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getHeight, getLocation, getLocationOnScreen, getName, getParent, getSize, getWidth, hasFocus, hide, invalidate, isDisplayed, isEnabled, isFocusTraversable, isTotallyObscured, isValid, isVisible, minimumSize, processEvent, processFocusEvent, processKeyEvent, processMouseEvent, repaint, requestFocus, requestSync, setBackground, setBounds, setBounds, setBounds, setEnabled, setForeground, setLocation, setLocation, setName, setParent, setVisible, show, validate, validateCursesColor

Field Details

_size

protected Dimension _size

Constructor Details

JMenuItem

public JMenuItem()
Create a menu item without text.

JMenuItem

public JMenuItem(String text_)
Create a menu item with the specified text.

JMenuItem

public JMenuItem(String text_,
                 int mnemonic_)
Create a menu item with the specified text and the specified mnemonic.
Parameters:
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.

Method Details

debug

public void debug(int level_)
Outputs a textual description of this component to stderr.
Overrides:
debug in interface Component

draw

public void draw()
Overrides:
draw in interface JComponent

getHeight

public int getHeight()
Overrides:
getHeight in interface Component

getSize

public Dimension getSize()
Overrides:
getSize in interface Component

getWidth

public int getWidth()
Overrides:
getWidth in interface Component

minimumSize

public Dimension minimumSize()
Overrides:
minimumSize in interface Component

requestFocus

public void requestFocus()
Overrides:
requestFocus in interface Component

toString

public String toString()