String trialId = dialog.getTrialId();
final String trialId = dialog.getTrialId();
  private void selectExperimentFromDatabase(DefaultMutableTreeNode node) {    // select experiment from database    Hashtable experimentNamesHT = ExperimentDB.getExperimentNames();    Set dbExperimentNames = experimentNamesHT.keySet();    if (dbExperimentNames == null)      return;    // for debugging, print experiment names and ids    Object[] tmp = dbExperimentNames.toArray();    for (int i = 0; i < tmp.length; i++)       System.out.println("Experiment name: " + tmp[i] +                         " Experiment id: " + experimentNamesHT.get(tmp[i]));    // end for debugging    JComboBox cb = new JComboBox(dbExperimentNames.toArray());    cb.setEditable(false);    JPanel panel = new JPanel();    panel.add(new JLabel("Select Experiment:"));    panel.add(cb);    int result =       JOptionPane.showConfirmDialog(null, panel, "Experiment",                                    JOptionPane.OK_CANCEL_OPTION,                                    JOptionPane.PLAIN_MESSAGE);    if (result != JOptionPane.OK_OPTION)      return;    String experimentName = (String)cb.getSelectedItem();    String experimentId = (String)experimentNamesHT.get(experimentName);    // produce an unique name for CSMART if necessary    if (experimentNames.contains(experimentName)) {      experimentName =         getUniqueExperimentName(experimentNames.generateName(experimentName));      if (experimentName == null)        return;    }    // if defining new experiment, select society template next//      if (!((ArrayList)experimentNames).contains(experimentName)) {//        societyTemplates = ExperimentDB.getSocietyTemplates();//        Set societyNames = societyTemplates.keySet();//        JComboBox societyCB = new JComboBox(societyNames.toArray());//        societyCB.setEditable(false);//        JPanel societyPanel = new JPanel();//        societyPanel.add(new JLabel("Select Society Template:"));//        societyPanel.add(societyCB);//        result = //          JOptionPane.showConfirmDialog(null, societyPanel, "Society Template",//                                        JOptionPane.OK_CANCEL_OPTION,//                                        JOptionPane.PLAIN_MESSAGE);//        if (result != JOptionPane.OK_OPTION)//          return null;//        societyTemplateName = societyCB.getSelectedItem();//      }    // get threads and groups information    CMTDialog dialog =       new CMTDialog(csmart, this, experimentName, experimentId);    String trialId = dialog.getTrialId();    if (trialId == null)      return;    createCMTExperiment(node,                         dialog.getExperimentName(),                        dialog.getExperimentId(),                        trialId,                        dialog.isCloned());//      try {//        new Thread("") {//          public void run() {//            createCMTExperiment(node, experimentName,//                                assemblyIDs, nodes, agents);//          }//        }.start();//      } catch (RuntimeException e) {//      }  }