SocietyComponent society = experiment.getSocietyComponent(); if (society != null) societyNames.remove(society.getSocietyName()); int n = experiment.getRecipeComponentCount(); for (int i = 0; i < n; i++) recipeNames.remove(experiment.getRecipeComponent(i).getRecipeName());
  protected void deleteExperimentInNode(DefaultMutableTreeNode node) {    if (node == null) return;    Experiment experiment = (Experiment)node.getUserObject();    if (!experiment.isEditable()) {      int result =         JOptionPane.showConfirmDialog(this,                                      "Experiment " +                                      experiment.getExperimentName() +                                      " is not editable; delete anyway?",                                      "Experiment Not Editable",                                      JOptionPane.YES_NO_OPTION,                                      JOptionPane.WARNING_MESSAGE);      if (result != JOptionPane.YES_OPTION)	return;    }    model.removeNodeFromParent(node);    String experimentName = experiment.getExperimentName();     experimentNames.remove(experimentName);    // ask if experiment should be deleted from database    int result =       JOptionPane.showConfirmDialog(this,                                    "Delete experiment " +                                    experiment.getExperimentName() +                                     " from database?",                                    "Delete Experiment From Database",                                    JOptionPane.YES_NO_OPTION,                                    JOptionPane.WARNING_MESSAGE);    if (result != JOptionPane.YES_OPTION)      return;    ExperimentDB.deleteExperiment(experiment.getExperimentID(),                                  experimentName);  }