nameServerHostName = null;
  private void runButton_actionPerformed() {    destroyOldNodes(); // Get rid of any old stuff before creating the new    userStoppedTrials = false;    ArrayList nodesToUse = new ArrayList();    hostsToUse = new ArrayList(); // hosts that nodes are on    nameServerHostName = null;    HostComponent[] hosts = experiment.getHosts();    for (int i = 0; i < hosts.length; i++) {      NodeComponent[] nodes = hosts[i].getNodes();      for (int j = 0; j < nodes.length; j++) {	AgentComponent[] agents = nodes[j].getAgents();	// skip nodes that have no agents	if (agents == null || agents.length == 0)	  continue;	nodesToUse.add(nodes[j]);	// record host for each node	hostsToUse.add(hosts[i].getShortName());      }    }    nodesToRun =      (NodeComponent[])nodesToUse.toArray(new NodeComponent[nodesToUse.size()]);    hostsToRunOn =       (String[])hostsToUse.toArray(new String[hostsToUse.size()]);    if (hostsToRunOn.length > 0)       nameServerHostName = hostsToRunOn[0];    // this state should be detected earlier and the run button disabled    if (!haveMoreTrials()) {      System.out.println("CSMARTConsole: WARNING: no more trials to run");      runButton.setSelected(false);      runButton.setEnabled(false);      return; // nothing to run    }    // query user for results directory before running the first time    getResultDir();     if (nodesToRun.length != 0)       runTrial();  }