All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.swing.JMenuItem
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.swing.JComponent
|
+----java.awt.swing.AbstractButton
|
+----java.awt.swing.JMenuItem
- public class JMenuItem
- extends AbstractButton
- implements Accessible
An implementation of a MenuItem
JMenuItem()
- Creates a menuItem with no set text or icon.
JMenuItem(Icon)
- Creates a menuItem with an icon.
JMenuItem(String)
- Creates a menuItem with text.
JMenuItem(String, Icon)
- Creates a menuItem with the supplied text and icon.
JMenuItem(String, MenuShortcut)
- Creates a menuItem using the supplied AWT MenuShortcut as the keyAccelerator
deleteShortcut()
-
getAccessibleActionDescription(int)
- Return a description of the specified action of the object.
getAccessibleRole()
- Get the role of this object.
getShortcut()
-
getUIClassID()
-
init(String, Icon)
-
requestFocus()
- Set focus on the receiving component if isRequestFocusEnabled returns true
setArmed(boolean)
-
setEnabled(boolean)
- Enables (or disables) the button.
setShortcut(MenuShortcut)
-
setUI(MenuItemUI)
- Sets the menuitem's UI.
updateUI()
- Gets a new UI object from the default UIFactory.
JMenuItem
public JMenuItem()
- Creates a menuItem with no set text or icon.
JMenuItem
public JMenuItem(Icon icon)
- Creates a menuItem with an icon.
- Parameters:
- icon - the icon of the MenuItem.
JMenuItem
public JMenuItem(String text)
- Creates a menuItem with text.
- Parameters:
- text - the text of the MenuItem.
JMenuItem
public JMenuItem(String text,
Icon icon)
- Creates a menuItem with the supplied text and icon.
- Parameters:
- text - the text of the MenuItem.
- icon - the icon of the MenuItem.
JMenuItem
public JMenuItem(String text,
MenuShortcut shortcut)
- Creates a menuItem using the supplied AWT MenuShortcut as the keyAccelerator
- Parameters:
- text - the text of the MenuItem.
- shortcut - the MenuShortcut for the menu
init
protected void init(String text,
Icon icon)
- Overrides:
- init in class AbstractButton
setUI
public void setUI(MenuItemUI ui)
- Sets the menuitem's UI.
- Parameters:
- ui - the new MenuItemUI
- See Also:
- getUI
updateUI
public void updateUI()
- Gets a new UI object from the default UIFactory.
- Overrides:
- updateUI in class AbstractButton
getUIClassID
public String getUIClassID()
- Returns:
- "MenuItemUI"
- Overrides:
- getUIClassID in class JComponent
- See Also:
- getUIClassID, getUI
requestFocus
public void requestFocus()
- Set focus on the receiving component if isRequestFocusEnabled returns true
- Overrides:
- requestFocus in class JComponent
setArmed
public void setArmed(boolean b)
setEnabled
public void setEnabled(boolean b)
- Enables (or disables) the button.
- Overrides:
- setEnabled in class AbstractButton
deleteShortcut
public void deleteShortcut()
setShortcut
public void setShortcut(MenuShortcut s)
getShortcut
public MenuShortcut getShortcut()
getAccessibleRole
public AccessibleRole getAccessibleRole()
- Get the role of this object.
- Returns:
- an instance of AccessibleRole describing the role of the object
- Overrides:
- getAccessibleRole in class JComponent
getAccessibleActionDescription
public String getAccessibleActionDescription(int i)
- Return a description of the specified action of the object.
- Parameters:
- i - zero-based index of the actions
- Returns:
- a description of the action ("select")
- Overrides:
- getAccessibleActionDescription in class AbstractButton
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature