trialProgressBar.setValue(experiment.getTrialCount() + 1); updateExperimentControls(experiment, false);
if (experiment != null) trialProgressBar.setValue(experiment.getTrialCount() + 1); updateControls(false);
  private void experimentFinished() {    trialProgressBar.setValue(experiment.getTrialCount() + 1);    updateExperimentControls(experiment, false);    //    runButton.setEnabled(false);    runButton.setSelected(false);    // allow user to run experiment again    runButton.setEnabled(true);    // reset trial counter    currentTrial = -1;    experimentTimer.stop();  }