All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.JMenuItem

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.AbstractButton
                                   |
                                   +----com.sun.java.swing.JMenuItem

public class JMenuItem
extends AbstractButton
An implementation of a MenuItem


Variable Index

 o action

Constructor Index

 o JMenuItem()
Creates a menuItem with no set text or icon.
 o JMenuItem(Icon)
Creates a menuItem with an icon.
 o JMenuItem(String)
Creates a menuItem with text.
 o JMenuItem(String, Icon)
Creates a menuItem.

Method Index

 o init(String, Icon)
 o requestFocus()
 o setAction(Action)
Sets the action to be involed by the JMenuItem
 o setArmed(boolean)
 o setEnabled(boolean)
Enables (or disables) the button.
 o setUI(MenuItemUI)
Sets the menuitem's UI.
 o updateUI()
Gets a new UI object from the default UIFactory.

Variables

 o action
 protected Action action

Constructors

 o JMenuItem
 public JMenuItem()
Creates a menuItem with no set text or icon.

 o JMenuItem
 public JMenuItem(Icon icon)
Creates a menuItem with an icon.

Parameters:
icon - the icon of the MenuItem.
 o JMenuItem
 public JMenuItem(String text)
Creates a menuItem with text.

Parameters:
text - the text of the MenuItem.
 o JMenuItem
 public JMenuItem(String text,
                  Icon icon)
Creates a menuItem.

Parameters:
text - the text of the MenuItem.
icon - the icon of the MenuItem.

Methods

 o init
 protected void init(String text,
                     Icon icon)
Overrides:
init in class AbstractButton
 o setUI
 public void setUI(MenuItemUI ui)
Sets the menuitem's UI.

Parameters:
ui - the new MenuItemUI
See Also:
getUI
 o updateUI
 public void updateUI()
Gets a new UI object from the default UIFactory.

Overrides:
updateUI in class AbstractButton
 o setAction
 public void setAction(Action action)
Sets the action to be involed by the JMenuItem

Parameters:
action - the Action
 o requestFocus
 public void requestFocus()
Overrides:
requestFocus in class Component
 o setArmed
 public void setArmed(boolean b)
 o setEnabled
 public void setEnabled(boolean b)
Enables (or disables) the button.

Overrides:
setEnabled in class AbstractButton

All Packages  Class Hierarchy  This Package  Previous  Next  Index