if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame);
if (frame.isSelected()) activateFrame(frame); else deactivateFrame(frame);
    public void propertyChange(PropertyChangeEvent evt)    {      if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY))        {	  if (frame.isMaximum())	    maximizeFrame(frame);	  else	    minimizeFrame(frame);        }      else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY))        {	  if (frame.isIcon())	    iconifyFrame(frame);	  else	    deiconifyFrame(frame);        }      else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY))        {	  if (frame.isSelected())	    activateFrame(frame);	  else	    getDesktopManager().deactivateFrame(frame);        }      else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY)               || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY))        {	  Component old = (Component) evt.getOldValue();	  old.removeMouseListener(glassPaneDispatcher);	  old.removeMouseMotionListener(glassPaneDispatcher);	  Component newPane = (Component) evt.getNewValue();	  newPane.addMouseListener(glassPaneDispatcher);	  newPane.addMouseMotionListener(glassPaneDispatcher);	  frame.revalidate();        }      /* FIXME: need to add ancestor properties to JComponents.      else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY))      {        if (desktopPane != null)          desktopPane.removeComponentListener(componentListener);        desktopPane = frame.getDesktopPane();        if (desktopPane != null)          desktopPane.addComponentListener(componentListener);      }      */    }