| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectpublic class JMenuextends JMenuItemField Summary |
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 | |
| |
| |
| |
Method Summary | |
JMenuItem |
|
JMenuItem | |
void |
|
void |
|
void |
|
void |
|
int | |
JMenuItem |
|
JPopupMenu |
|
Dimension |
|
int |
|
boolean |
|
boolean |
|
Dimension | |
void |
|
void |
|
void |
|
String |
|
Methods inherited from class charvax.swing.JMenuItem | |
debug, draw, getHeight, getSize, getWidth, minimumSize, requestFocus, 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 | |
public JMenu()
Constructs a new JMenu with no text (the text can be set later with the setText() method of the superclass).
public JMenu(String text_)
Constructs a new JMenu with the specified string as its text
public JMenu(String text_,
int mnemonic_)Constructs a new JMenu with the specified text and the specified mnemonic character (which must appear in the text).
public JMenuItem add(String text_)
Create a JMenuItem with the specified label and add it to the menu.
- Returns:
- a reference to the newly created JMenuItem.
public JMenuItem add(JMenuItem item_)
Add a JMenuItem (or JMenu) to the end of this JMenu.
- Returns:
- the JMenuItem that was added.
public void addSeparator()
Add a horizontal separator to the end of the menu.
public void debug(int level_)
Output a text description of the menu.
public void draw()
To be implemented by concrete subclasses.
public void fireActionPerformed(ActionEvent ae_)
Invoke all the ActionListener callbacks that may have been registered for this button.
- Overrides:
- fireActionPerformed in interface AbstractButton
public JMenuItem getMenuItem(int index_)
Returns the menu item at the specified index. If the object at the specified index is a JSeparator, it returns null.
public boolean isPopupMenuVisible()
Returns true if the popup window of this menu is displayed.
public boolean isTopLevelMenu()
Returns true if this menu is the direct child of a menubar.
public void setBackground(Color color_)
Sets the background color of this JMenu and all its contained JMenuItems that do not yet have their background color set. Overrides the same method in the Component class.
- Overrides:
- setBackground in interface Component
public void setForeground(Color color_)
Sets the foreground color of this JMenu and all its contained JMenuItems that do not yet have their foreground color set. Overrides the same method in the Component class.
- Overrides:
- setForeground in interface Component
public void setPopupMenuVisible(boolean visible_)
Displays this menu's popup menu if the specified value is true; hides the menu if it is false.