Class PopupMenu

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, MenuElement

public class PopupMenu extends JPopupMenu
convenience class for constructing popup menus
See Also:
  • Constructor Details

    • PopupMenu

      public PopupMenu(JComponent pop, String menuTitle)
      Constructor.
      Parameters:
      pop - MouseListener is added to this JComponent.
      menuTitle - title of the popup menu.
  • Method Details

    • addAction

      public void addAction(String menuName, AbstractAction act)
      Add an action to the popup menu. Note that the menuName is made the NAME value of the action.
      Parameters:
      menuName - name of the action on the menu.
      act - the Action.
    • addActionCheckBox

      public void addActionCheckBox(String menuName, AbstractAction act, boolean state)
      Add an action to the popup menu, using a JCheckBoxMenuItem. Fetch the toggle state using:
      Boolean state = (Boolean) act.getValue(BAMutil.STATE); 
      Parameters:
      menuName - name of the action on the menu.
      act - the Action.
      state - : initial state of the checkbox