} try { properties.put("env.DISPLAY", InetAddress.getLocalHost().getHostName() + ":0.0"); } catch (UnknownHostException uhe) { System.out.println(uhe);
  private boolean createNode(NodeComponent nodeComponent, String hostName) {    String nodeName = nodeComponent.getShortName();    // create an unique node name to circumvent server problems    String uniqueNodeName = nodeName;    // Can't change the name of the Nodes when running    // from the database, cause it needs to load those names    if (!experiment.isInDatabase()) {      uniqueNodeName = nodeName + currentTrial;    }        // create a status button    NodeStatusButton statusButton = createStatusButton(nodeName, hostName);    ConsoleStyledDocument doc = new ConsoleStyledDocument();    ConsoleTextPane textPane = new ConsoleTextPane(doc, statusButton);    JScrollPane scrollPane = new JScrollPane(textPane);    // create a node event listener to get events from the node    NodeEventListener listener = null;    String logFileName = getLogFileName(nodeName);    try {      listener = new ConsoleNodeListener(this,					 nodeComponent,                                         logFileName,					 statusButton,                                         doc);    } catch (Exception e) {      System.err.println("Unable to create output for: " + nodeName);      e.printStackTrace();      return false;    }    if (notifyCondition != null)      textPane.setNotifyCondition(notifyCondition);    ((ConsoleStyledDocument)textPane.getStyledDocument()).setBufferSize(viewSize);    if (displayFilter != null)      ((ConsoleNodeListener)listener).setFilter(displayFilter);    nodeListeners.put(nodeName, listener);    nodePanes.put(nodeName, textPane);    NodeEventFilter filter = new NodeEventFilter(10);    // note that these properties augment any properties that    // are passed to the server in a properties file on startup    // TODO: DBMode should be dependent on society selected    Properties properties = new Properties();    properties.put("org.cougaar.node.name", uniqueNodeName);    String nameServerPorts = "8888:5555";    properties.put("org.cougaar.tools.server.nameserver.ports",                    nameServerPorts);    properties.put("org.cougaar.name.server", 		   nameServerHostName + ":" + nameServerPorts);    properties.put("org.cougaar.control.port", Integer.toString(DEFAULT_PORT));    if (!experiment.isInDatabase()) {      properties.put("org.cougaar.filename", uniqueNodeName + ".ini");    } else {      properties.put("org.cougaar.configuration.database",                      CSMART.getDatabaseConfiguration());      properties.put("org.cougaar.configuration.user",                      CSMART.getDatabaseUserName());      properties.put("org.cougaar.configuration.password",                      CSMART.getDatabaseUserPassword());      properties.put("org.cougaar.experiment.id", experiment.getTrialID());    }    // set configuration file names in nodesToRun    for (int i = 0; i < nodesToRun.length; i++)       ((ConfigurableComponent)nodesToRun[i]).addProperty("ConfigurationFileName", 				nodesToRun[i].getShortName() + currentTrial);    ConfigurationWriter configWriter = null;    configWriter = experiment.getConfigurationWriter(nodesToRun);    // create the node    NodeServesClient nsc = null;    try {      HostServesClient hsc = communitySupport.getHost(hostName, DEFAULT_PORT);      System.out.println("Host: " + hostName + " port: " + DEFAULT_PORT +                          " name: " + uniqueNodeName);      nsc = hsc.createNode(uniqueNodeName, properties, null,                           listener, filter, configWriter);      if (nsc != null)	runningNodes.put(nodeComponent, nsc);    } catch (Exception e) {       System.out.println("CSMARTConsole: cannot create node: " + nodeName);       JOptionPane.showMessageDialog(this,				     "Cannot create node on: " + hostName +				     "; check that server is running");       e.printStackTrace();       return false;    }        // only add gui controls if successfully created node    addStatusButton(statusButton);    desktop.addNodeFrame(nodeComponent,                          (ConsoleNodeListener)listener,                          new NodeFrameListener(),                         scrollPane,                         statusButton,                         logFileName,                         nsc);    updateExperimentControls(experiment, true);    startTimers();    return true;  }