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
- 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()
-
-
getAccessibleRole()
- Get the role of this object.
-
getAccessibleStateSet()
- Get the accessible state set 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()
getAccessibleStateSet
public AccessibleStateSet getAccessibleStateSet()
- Get the accessible state set of this object.
- Returns:
- an instance of AccessibleState containing the current state
of the object
- Overrides:
- getAccessibleStateSet in class AbstractButton
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
All Packages Class Hierarchy This Package Previous Next Index