if (result == JOptionPane.YES_OPTION) ExperimentDB.deleteExperiment(experiment.getExperimentID());
if (result != JOptionPane.YES_OPTION) return;  final String id = experiment.getExperimentID(); GUIUtils.timeConsumingTaskStart(organizer); try { new Thread("DeleteExperiment") { public void run() { ExperimentDB.deleteExperiment(id); GUIUtils.timeConsumingTaskEnd(organizer); } }.start(); } catch (RuntimeException re) { System.out.println("Runtime exception deleting experiment: " + re); re.printStackTrace(); GUIUtils.timeConsumingTaskEnd(organizer); }
  private void deleteExperiment(DefaultMutableTreeNode node) {    if (node == null) return;    Experiment experiment = (Experiment)node.getUserObject();    if (!experiment.isEditable()) {      String reason = "has been run";      if (experiment.isRunning())	reason = "is in use";      int result = JOptionPane.showConfirmDialog(this,						 "Experiment " + reason + "; delete anyway?",						 "Experiment Not Editable",						 JOptionPane.YES_NO_OPTION,						 JOptionPane.WARNING_MESSAGE);      if (result != JOptionPane.YES_OPTION)	return;    }    model.removeNodeFromParent(node);    experimentNames.remove(experiment.getExperimentName());    // if experiment was in database, ask if it should be deleted from there    if (experiment.isInDatabase()) {      int result =         JOptionPane.showConfirmDialog(this,                                      "Delete experiment from database?",                                      "Delete Experiment From Database",                                      JOptionPane.YES_NO_OPTION,                                      JOptionPane.WARNING_MESSAGE);      if (result == JOptionPane.YES_OPTION)        ExperimentDB.deleteExperiment(experiment.getExperimentID());    }  }