if (! menu.isTopLevelMenu() || (menu.isTopLevelMenu() && (((JMenuBar) menu.getParent()).isSelected() && ! menu.isArmed())))
if (! menu.isTopLevelMenu() || popupVisible())
    public void mouseEntered(MouseEvent e)    {      /* When mouse enters menu item, it should be considered selected       if (i) if this menu is a submenu in some other menu          (ii) or if this menu is in a menu bar and some other menu in a menu bar was just               selected. (If nothing was selected, menu should be pressed before               it will be selected)            */      JMenu menu = (JMenu) menuItem;      if (! menu.isTopLevelMenu()          || (menu.isTopLevelMenu()          && (((JMenuBar) menu.getParent()).isSelected() && ! menu.isArmed())))        {	  // set new selection and forward this event to MenuSelectionManager	  MenuSelectionManager manager = MenuSelectionManager.defaultManager();	  manager.setSelectedPath(getPath());	  manager.processMouseEvent(e);        }    }