if (e instanceof ActionEvent) { NamedFrame.getNamedFrame().removeFrame(this); } else { if (log.isDebugEnabled()) { log.debug("Not doing a removeFrame: event was " + e); } }
  private void exit(AWTEvent e) {    if (log.isDebugEnabled()) {      log.debug("In exitMenuItem_actionPerformed");    }    if (model.haveAttached()) {      ExitConsole ec = new ExitConsole();      if (ec.reallyExit()) {        if (ec.getResult().equals(ec.SOCIETY_DETACH)) {          model.detachFromSociety();        } else if (ec.getResult().equals(ec.KILL_NODES)) {          model.killAllNodes();        }      } else {        return;      }    }    // If this was this frame's exit menu item, we have to remove    // the window from the list    // if it was a WindowClose, the parent notices this as well//    if (e instanceof ActionEvent) {//      NamedFrame.getNamedFrame().removeFrame(this);//    } else {//      if (log.isDebugEnabled()) {//        log.debug("Not doing a removeFrame: event was " + e);//      }//    }////    // remove listeners from this window//    WindowListener[] lists = getWindowListeners();//    for (int i = 0; i < lists.length; i++)//      removeWindowListener(lists[i]);    dispose();    System.exit(0);  }