String newName = getUniqueName("New folder name", "Folder Name Not Unique", folderNames);
String originalName = (String)(getSelectedNode().getUserObject()); String newName = getUniqueFolderName(originalName, true);
  public void renameFolder() {    String newName = getUniqueName("New folder name",                                   "Folder Name Not Unique",                                   folderNames);    if (newName == null) return;    DefaultMutableTreeNode node = getSelectedNode();    if (node.getUserObject().equals(newName))      return;    node.setUserObject(newName);    model.nodeChanged(node);  }