public void stateChanged(ChangeEvent e) {
setDefaultButton();
}
});
buttonLogin.addActionListener(new DialogAction(this) {
public void run() {
login();
}
});
buttonCancel.addActionListener(new DialogAction(this) {
public void run() {
cancel();
}
});
labelAcceptTerms.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent me) {
startBrowserForTerms(LoginDialog.this);
}
});
buttonRegister.addActionListener(new DialogAction(this) {
public void run() {
register();
}
});
buttonCancel2.addActionListener(new DialogAction(this) {
public void run() {
cancel();
}
});
textFieldLogin.setText(RouteConverter.getInstance().getCredentials().getUserName());
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
cancel();
}
});
contentPane.registerKeyboardAction(new DialogAction(this) {
public void run() {
cancel();
}
}, getKeyStroke(VK_ESCAPE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
}