switch (evt.getID()) { case WindowEvent.WINDOW_ACTIVATED: windowListener.windowActivated(evt); break; case WindowEvent.WINDOW_CLOSED: windowListener.windowClosed(evt); break; case WindowEvent.WINDOW_CLOSING: windowListener.windowClosing(evt); break; case WindowEvent.WINDOW_DEACTIVATED: windowListener.windowDeactivated(evt); break; case WindowEvent.WINDOW_DEICONIFIED: windowListener.windowDeiconified(evt); break; case WindowEvent.WINDOW_ICONIFIED: windowListener.windowIconified(evt); break; case WindowEvent.WINDOW_OPENED: windowListener.windowOpened(evt); break; case WindowEvent.WINDOW_GAINED_FOCUS: case WindowEvent.WINDOW_LOST_FOCUS: processWindowFocusEvent (evt); break; case WindowEvent.WINDOW_STATE_CHANGED: processWindowStateEvent (evt); break; }
if (windowListener != null) { switch (evt.getID()) { case WindowEvent.WINDOW_ACTIVATED: windowListener.windowActivated(evt); break;  case WindowEvent.WINDOW_CLOSED: windowListener.windowClosed(evt); break;  case WindowEvent.WINDOW_CLOSING: windowListener.windowClosing(evt); break;  case WindowEvent.WINDOW_DEACTIVATED: windowListener.windowDeactivated(evt); break;  case WindowEvent.WINDOW_DEICONIFIED: windowListener.windowDeiconified(evt); break;  case WindowEvent.WINDOW_ICONIFIED: windowListener.windowIconified(evt); break;  case WindowEvent.WINDOW_OPENED: windowListener.windowOpened(evt); break;  default: break; } }
  protected void processWindowEvent(WindowEvent evt)  {    if (windowListener != null)      {        switch (evt.getID())          {          case WindowEvent.WINDOW_ACTIVATED:            windowListener.windowActivated(evt);            break;          case WindowEvent.WINDOW_CLOSED:            windowListener.windowClosed(evt);            break;          case WindowEvent.WINDOW_CLOSING:            windowListener.windowClosing(evt);            break;          case WindowEvent.WINDOW_DEACTIVATED:            windowListener.windowDeactivated(evt);            break;          case WindowEvent.WINDOW_DEICONIFIED:            windowListener.windowDeiconified(evt);            break;          case WindowEvent.WINDOW_ICONIFIED:            windowListener.windowIconified(evt);            break;          case WindowEvent.WINDOW_OPENED:            windowListener.windowOpened(evt);            break;          case WindowEvent.WINDOW_GAINED_FOCUS:          case WindowEvent.WINDOW_LOST_FOCUS:            processWindowFocusEvent (evt);            break;          case WindowEvent.WINDOW_STATE_CHANGED:            processWindowStateEvent (evt);            break;          }      }  }