| Package | Description | 
|---|---|
| javax.swing | Provides a set of "lightweight"
(all-Java language) components that,
to the maximum degree possible, work the same on all platforms. | 
| javax.swing.plaf.basic | Provides user interface objects built according to the
Basic look and feel. | 
| Modifier and Type | Class and Description | 
|---|---|
| class  | JCheckBoxMenuItemA menu item that can be selected or deselected. | 
| class  | JMenuAn implementation of a menu -- a popup window containing
  JMenuItems that
 is displayed when the user selects an item on theJMenuBar. | 
| class  | JRadioButtonMenuItemAn implementation of a radio button menu item. | 
| Modifier and Type | Method and Description | 
|---|---|
| JMenuItem | JMenu. add(Action a)Creates a new menu item attached to the specified
  Actionobject and appends it to the end of this menu. | 
| JMenuItem | JPopupMenu. add(Action a)Appends a new menu item to the end of the menu which
 dispatches the specified  Actionobject. | 
| JMenuItem | JMenu. add(JMenuItem menuItem)Appends a menu item to the end of this menu. | 
| JMenuItem | JPopupMenu. add(JMenuItem menuItem)Appends the specified menu item to the end of this menu. | 
| JMenuItem | JMenu. add(String s)Creates a new menu item with the specified text and appends
 it to the end of this menu. | 
| JMenuItem | JPopupMenu. add(String s)Creates a new menu item with the specified text and appends
 it to the end of this menu. | 
| protected JMenuItem | JMenu. createActionComponent(Action a)Factory method which creates the  JMenuItemforActions added to theJMenu. | 
| protected JMenuItem | JPopupMenu. createActionComponent(Action a)Factory method which creates the  JMenuItemforActionsadded to theJPopupMenu. | 
| JMenuItem | JMenu. getItem(int pos)Returns the  JMenuItemat the specified position. | 
| JMenuItem | JMenu. insert(Action a,
      int pos)Inserts a new menu item attached to the specified  Actionobject at a given position. | 
| JMenuItem | JMenu. insert(JMenuItem mi,
      int pos)Inserts the specified  JMenuitemat a given position. | 
| Modifier and Type | Method and Description | 
|---|---|
| JMenuItem | JMenu. add(JMenuItem menuItem)Appends a menu item to the end of this menu. | 
| JMenuItem | JPopupMenu. add(JMenuItem menuItem)Appends the specified menu item to the end of this menu. | 
| protected PropertyChangeListener | JMenu. createActionChangeListener(JMenuItem b)Returns a properly configured  PropertyChangeListenerwhich updates the control as changes to theActionoccur. | 
| protected PropertyChangeListener | JPopupMenu. createActionChangeListener(JMenuItem b)Returns a properly configured  PropertyChangeListenerwhich updates the control as changes to theActionoccur. | 
| JMenuItem | JMenu. insert(JMenuItem mi,
      int pos)Inserts the specified  JMenuitemat a given position. | 
| void | JMenu. remove(JMenuItem item)Removes the specified menu item from this menu. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected JMenuItem | BasicMenuItemUI. menuItem | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | BasicMenuItemUI. installComponents(JMenuItem menuItem) | 
| protected void | BasicMenuItemUI. paintBackground(Graphics g,
               JMenuItem menuItem,
               Color bgColor)Draws the background of the menu item. | 
| protected void | BasicMenuItemUI. paintText(Graphics g,
         JMenuItem menuItem,
         Rectangle textRect,
         String text)Renders the text of the current menu item. | 
| void | BasicRadioButtonMenuItemUI. processMouseEvent(JMenuItem item,
                 MouseEvent e,
                 MenuElement[] path,
                 MenuSelectionManager manager) | 
| void | BasicCheckBoxMenuItemUI. processMouseEvent(JMenuItem item,
                 MouseEvent e,
                 MenuElement[] path,
                 MenuSelectionManager manager) | 
| protected void | BasicMenuItemUI. uninstallComponents(JMenuItem menuItem) | 
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.