if (s != null && s.length() != 0) setPropertyOfNode(hostTree, "MachineType", s);
if (s != null && s.trim().length() != 0) setPropertyOfNode(hostTree, "MachineType", s.trim());
  public void setHostType() {    String machineType = getPropertyOfNode(hostTree, "MachineType");    String[] machineTypes = { "Linux", "Solaris", "Windows" };    String s = (String)JOptionPane.showInputDialog(this,                                           "Enter Host Machine Type",                                           "Host Machine Type",                                           JOptionPane.QUESTION_MESSAGE,                                           null, machineTypes, machineType);    if (s != null && s.length() != 0)       setPropertyOfNode(hostTree, "MachineType", s);  }