All Implemented Interfaces:
Component, Interactable, TextGUIElement

public class Menu extends MenuItem
Implementation of a drop-down menu contained in a MenuBar and also a sub-menu inside another Menu.
  • Field Details

  • Constructor Details

    • Menu

      public Menu(String label)
      Creates a menu with the specified label
      Parameters:
      label - Label to use for the menu item that will trigger this menu to pop up
  • Method Details

    • add

      public Menu add(MenuItem menuItem)
      Adds a new menu item to this menu, this can be either a regular MenuItem or another Menu
      Parameters:
      menuItem - The item to add to this menu
      Returns:
      Itself
    • onActivated

      protected boolean onActivated()
      Description copied from class: MenuItem
      Method to invoke when a menu item is "activated" by pressing the Enter key.
      Overrides:
      onActivated in class MenuItem
      Returns:
      Returns true if the action was performed successfully, otherwise false, which will not automatically close the popup window itself.