private String getUniqueName(String prompt, String errorMsgTitle, UniqueNameSet uniqueNames) { String name;
private String getUniqueName(String prompt, UniqueNameSet names, String originalName, boolean allowExistingName, String databaseCheck) { Method dbCheckMethod = null; String name = null;
  private String getUniqueName(String prompt, String errorMsgTitle,                               UniqueNameSet uniqueNames) {    String name;    while (true) {      name = JOptionPane.showInputDialog(prompt);      if (name == null || name.equals(""))        return null;      if (!uniqueNames.contains(name)) break;      int result = JOptionPane.showConfirmDialog(this,                                                 "Use an unique name",                                                 errorMsgTitle,                                                 JOptionPane.OK_CANCEL_OPTION,                                                 JOptionPane.ERROR_MESSAGE);      if (result != JOptionPane.OK_OPTION)        return null;    }    return name;  }