firePropertyChange(VISIBLE_CHANGED_PROPERTY, old, (boolean) isVisible());
firePropertyChange("visible", old, isVisible());
  public void setVisible(boolean visible)  {    boolean old = isVisible();    this.visible = visible;    if (old != isVisible())      {	firePropertyChange(VISIBLE_CHANGED_PROPERTY, old, (boolean) isVisible());    if (visible)      {	    firePopupMenuWillBecomeVisible();	Container rootContainer = (Container) SwingUtilities.getRoot(invoker);	boolean fit = true;	Dimension size;	// Determine the size of the popup menu	if (this.getSize().width == 0 && this.getSize().width == 0)	  size = this.getPreferredSize();	else	  size = this.getSize();	    if ((size.width > (rootContainer.getWidth() - popupLocation.x))	        || (size.height > (rootContainer.getHeight() - popupLocation.y)))	  fit = false;	if (lightWeightPopupEnabled && fit)	  popup = new LightWeightPopup(this);	else	  {	    if (fit)	      popup = new MediumWeightPopup(this);	    else	      popup = new HeavyWeightPopup(this);	  }        if (popup instanceof LightWeightPopup             || popup instanceof MediumWeightPopup)          {            JLayeredPane layeredPane;		layeredPane = SwingUtilities.getRootPane(invoker)		                            .getLayeredPane();		Point p = new Point(popupLocation.x, popupLocation.y);		SwingUtilities.convertPointFromScreen(p, layeredPane);		popup.show(p.x, p.y, size.width, size.height);	      }	    else	      {		// Subtract insets of the top-level container if popup menu's		// top-left corner is inside it.		    Insets insets = rootContainer.getInsets();		    popup.show(popupLocation.x - insets.left,		               popupLocation.y - insets.top, size.width,		               size.height);          }       }    else      {	firePopupMenuWillBecomeInvisible();	popup.hide();      }  }  }