if (s != null && s.length() != 0) setPropertyOfNode(hostTree, "Location", s);
if (s != null && s.trim().length() != 0) setPropertyOfNode(hostTree, "Location", s.trim());
  public void setHostLocation() {    String location = getPropertyOfNode(hostTree, "Location");    String s = (String)JOptionPane.showInputDialog(this,                                           "Enter Host Location",                                           "Host Location",                                           JOptionPane.QUESTION_MESSAGE,                                           null, null, location);    if (s != null && s.length() != 0)       setPropertyOfNode(hostTree, "Location", s);  }