protected void processWindowEvent(WindowEvent e){
  if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    cancel();
  }
  super.processWindowEvent(e);
}

protected void processWindowEvent ( WindowEvent e ) { if ( e . getID ( ) == WindowEvent . WINDOW_CLOSING ) { cancel ( ) ; } super . processWindowEvent ( e ) ; }
overridden so we can exit when window is closed
