saveResults();
  public void stopButton_actionPerformed(ActionEvent e) {    stopButton.setSelected(true); // indicate stopping    stopButton.setEnabled(false); // disable until experiment stops    // determine if societies in an experiment are self terminating    //    Experiment experiment = csmart.getExperiment();    // if user selects another experiment in the organizer, ignore it!    //    if (experiment == null) {    //      System.err.println("Console lost the experiment!!!");    //      return;    //    }    int nSocieties = experiment.getSocietyComponentCount();    boolean isSelfTerminating = true;    for (int i = 0; i < nSocieties; i++) {      SocietyComponent society = experiment.getSocietyComponent(i);      if (!society.isSelfTerminating()) {	isSelfTerminating = false;	break;      }    }    // just tell the experiment to stop after the current trial    // societies in experiment will self terminate    if (isSelfTerminating) {      //      experiment.stop();      userStoppedTrials = true;      return;    }    // need to manually stop some societies    // if societies are being monitored, ask user to confirm stop    if (experiment.isMonitored()) {      int response = 	JOptionPane.showConfirmDialog(this,				      "Experiment is being monitored; stop anyway (society monitor displays will be destroyed)?",				      "Confirm Stop",				      JOptionPane.YES_NO_OPTION);      if (response == JOptionPane.YES_OPTION) 	stopAllNodes();    } else      stopAllNodes();    // Tell the societies that they are no longer running    // Tell the experiment it is no longer running    saveResults();  }