Class GameMenuItem

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

public class GameMenuItem extends JMenuItem
Game menu item to add to menu bar. With consistent colors for UI.
Author:
Molly
See Also:
  • Constructor Details

    • GameMenuItem

      public GameMenuItem(String name, ActionListener actionList, int width, ImageIcon imageIcon)
      Menu item with icon.
      Parameters:
      name - name of item
      actionList - action for item
      width - width of item
      imageIcon - icon for item
    • GameMenuItem

      public GameMenuItem(String name, ActionListener actionList)
      Menu item with name and action.
      Parameters:
      name - name for item
      actionList - action for item
  • Method Details

    • changeActionListener

      public void changeActionListener(ActionListener action)
      Change current action listener for new one.
      Parameters:
      action - new action for item
    • changeIcon

      public void changeIcon(ImageIcon imageIcon)
      Change icon on item.
      Parameters:
      imageIcon - new icon for item