public static CycAccess getNewCycAccessInteractively() {
    CycAccess cycAccess = null;
    String hostname = "localhost";
    final Integer[] ports = {3600, 3620, 3600, 3660, 3680};
    Integer port = ports[0];
    while (cycAccess == null) {
      hostname = JOptionPane.showInputDialog("Specify host machine:", hostname);
      if (hostname == null) {
        return null;
      }
      port = (Integer) JOptionPane.showInputDialog(
              null, "Specify port:", "Specify Port", JOptionPane.QUESTION_MESSAGE, null,
              ports, port);
      if (port == null) {
        return null;
      }
      try {
        cycAccess = new CycAccess(hostname, port);
      } catch (Exception ex) {
        final int result = JOptionPane.showConfirmDialog(null,
                "Got Exception trying to connect to " + hostname + ":" + port + ":\n" + ex.getLocalizedMessage()
                + "\nTry again?", "Exception", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
        if (result != JOptionPane.OK_OPTION) {
          return null;
        }
      }
    }
    return cycAccess;
  }