public CredentialsSelector() {
super((java.awt.Frame) null, true);
initComponents();
tfUserName.getActionMap().put(OK_ACTION_ID, okAction);
tfUserName.getActionMap().put(CANCEL_ACTION_ID, cancelAction);
tfPassword.getActionMap().put(OK_ACTION_ID, okAction);
tfPassword.getActionMap().put(CANCEL_ACTION_ID, cancelAction);
tfUserName.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), OK_ACTION_ID);
tfUserName.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CANCEL_ACTION_ID);
tfPassword.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), OK_ACTION_ID);
tfPassword.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CANCEL_ACTION_ID);
String userName = Preferences.userRoot().node(SETTINGS_NODE).get(LOGIN_SETTING, "");
if (userName != null && !userName.isEmpty()) {
tfUserName.setText(userName);
String password = Preferences.userRoot().node(SETTINGS_NODE).get(PASSWORD_SETTING, "");
tfPassword.setText(password);
checkRememberPassword.setSelected(true);
}
}