}
    private void mousePressed(MouseEvent ev)    {      // Autoclose all menus managed by the MenuSelectionManager.      MenuSelectionManager m = MenuSelectionManager.defaultManager();      Component target = ev.getComponent();      if (target instanceof Container)        target = ((Container) target).findComponentAt(ev.getPoint());      if (! m.isComponentPartOfCurrentMenu(target))        m.clearSelectedPath();    }