private void init() {
    setLocationRelativeTo(null);
    setDefaultCloseOperation(FLogin.DO_NOTHING_ON_CLOSE);
    addWindowListener(this);

    if (!Data.settings.username.isEmpty()) {
      tName.setText(Data.settings.username);
      tPassword.requestFocus();
    } else {
      tName.requestFocus();
    }

    //commons
    if (Data.settings.server.equals("commons.wikimedia.org")) {
      pServer.setSelectedIndex(0);
      rCommons.setSelected(true);
      //sister projects
    } else if (Data.settings.server.matches(".*wik[it](pedia|ionary|quote|books|source|species|news|versity|voyage)\\.org")) {
      pServer.setSelectedIndex(0);
      rWikimedia.setSelected(true);

      String prefix = Data.settings.server.substring(0, Data.settings.server.indexOf("."));
      tPrefix.setText(prefix);

      String domain = Data.settings.server.substring(prefix.length() + 1);
      for (int i = 0; i < cServer.getItemCount(); i++) {
        String s = cServer.getItemAt(i).toString();
        if (s.equals(domain)) {
          cServer.setSelectedIndex(i);
          break;
        }
      }
      //sth else
    } else {
      pServer.setSelectedIndex(1);
      tServer.setText(Data.settings.server);
      tProtocol.setText(Data.settings.protocol == null ? "http" : Data.settings.protocol);
      tPath.setText(Data.settings.path == null ? "/w" : Data.settings.path);
    }

    setVisible(true);
    getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(escapeKeyStroke, "ESCAPE");
    getRootPane().getActionMap().put("ESCAPE", escapeAction);
  }