Class FWMenuBar

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

public final class FWMenuBar extends JMenuBar
Author:
Andreas Enders Default menubar, which makes it much easier creating menus.
See Also:
  • Constructor Details

  • Method Details

    • addMenu

      public JMenu addMenu(String aMenuName)
      Creates a menu, add it to this menubar.
    • addMenu

      public JMenu addMenu(String aMenuName, JMenu aMenu)
      Creates a menu, add it to this menubar.
    • addSubMenu

      public JMenu addSubMenu(String aMenuName, String aParentMenu)
      Creates a menu, adds it to another menu.
    • addSeparator

      public void addSeparator(String aMenuName)
      Adds a separator to the given menu.
    • setEnabled

      public void setEnabled(String aActionCommand, boolean aEnabled)
      Enables/Disables an existing menuitem.
    • setVisible

      public void setVisible(String aActionCommand, boolean aEnabled)
      Shows/hides an existing menuitem.
    • setText

      public void setText(String aActionCommand, String aValue, boolean aEnabled)
      Set the caption (aValue) to the MenuItem but use the given ActionCommand
    • getMenuItem

      public JMenuItem getMenuItem(String aActionCommand)
      Returns the menuItem for the given ActionCommand or null if none exists.
    • getKeyStrokeFromString

      public KeyStroke getKeyStrokeFromString(String aCombination)
      Creates a keystroke out of a commaseperated string
    • getSelectionState

      public boolean getSelectionState(String aMenuName)
      Returns if the menuitem with the selected name is selected. If it's neither a radio nor a checkbox-item it will return false. Same if the item doesn't exist at all.
    • setSelectionState

      public void setSelectionState(String aMenuName, boolean aSelectionState)
      Sets a new selectionstate to the given menu. The menu should either be a checkBox or a radioButton.