firePropertyChange("visible", old, isVisible());
  public void setVisible(final boolean visible)  {    // Hook up this call so that it gets executed on the event thread in order    // to avoid synchronization problems when calling the layout manager.    if (! SwingUtilities.isEventDispatchThread())      {        SwingUtilities.invokeLater(new Runnable()          {            public void run()            {              setVisible(visible);            }          });      }    if (visible == isVisible())      return;    boolean old = isVisible();    this.visible = visible;    if (old != isVisible())      {        firePropertyChange("visible", old, isVisible());        if (visible)          {            firePopupMenuWillBecomeVisible();                        PopupFactory pf = PopupFactory.getSharedInstance();            pack();            popup = pf.getPopup(invoker, this, popupLocationX, popupLocationY);            popup.show();          }        else          {            firePopupMenuWillBecomeInvisible();            popup.hide();          }      }  }