JTextField tf = new JTextField("localhost:8484", 20);
JTextField tf = new JTextField("localhost:" + Experiment.APP_SERVER_DEFAULT_PORT, 20);
  public void addAppServer() {    JTextField tf = new JTextField("localhost:8484", 20);    JPanel panel = new JPanel();    panel.add(new JLabel("Enter HostName:Port:"));    panel.add(tf);    int result =       JOptionPane.showOptionDialog(null, panel, "Add Application Server",				   JOptionPane.OK_CANCEL_OPTION,				   JOptionPane.PLAIN_MESSAGE,				   null, null, null);    if (result != JOptionPane.OK_OPTION)      return;    String s = tf.getText().trim();    int index = s.indexOf(':');    if (index == -1)      return;    String hostName = s.substring(0, index);    hostName = hostName.trim();    if (hostName.equals(""))      return;    String port = s.substring(index+1);    port = port.trim();    int remotePort = 0;    try {      remotePort = Integer.parseInt(port);    } catch (Exception e) {      return;    }    if (remotePort < 1)      return;    RemoteHost appServer = getAppServer(hostName, remotePort);    if (appServer != null)      addAppServerWorker(new AppServerDesc(appServer, hostName, remotePort));  }