code: @Override
      public void quit() {
          super.quit();
  
          Scenario2DPortrayal scenarioPortrayal;
          try {
              scenarioPortrayal = (Scenario2DPortrayal) this.getSimulation()
                      .getScenarioPortrayal();
  
              HashMap<String, Display2D> displays = scenarioPortrayal
                      .getDisplays();
              HashMap<String, JFrame> frames = scenarioPortrayal.getFrameList();
              for (Entry<String, JFrame> frameEntry : frames.entrySet()) {
                  if (frameEntry.getValue() != null) {
                      frameEntry.getValue().dispose();
                  }
              }
              frames.clear();
              displays.clear();
          } catch (DuplicatedPortrayalIDException e) {
              logger.severe(e.getMessage());
              e.printStackTrace();
          } catch (ScenarioNotFoundException e) {
              logger.severe(e.getMessage());
              e.printStackTrace();
          } catch (ShanksException e) {
              logger.severe(e.getMessage());
              e.printStackTrace();
          }
          Console console = (Console) this.controller;
          console.dispose();
      }
docs: /*
  (non-Javadoc)
  
  @see sim.display.GUIState#quit()