if (getModel().isEnabled()) popupMenu.setVisible(popup);
if (popup != isPopupMenuVisible() && (isEnabled() || ! popup)) { if (popup && isShowing()) {  Point loc = menuLocation == null ? getPopupMenuOrigin() : menuLocation;  getPopupMenu().show(this, loc.x, loc.y);
  public void setPopupMenuVisible(boolean popup)  {    if (getModel().isEnabled())      popupMenu.setVisible(popup);  }