hey Guys.
I have 2 text fiwlds now on the login page, name and password.
The following code inst working. It enables the second field (password) on activation of the first (name), but it doesn't disable name
Instead I get the keystrokes in both fields when I type in the apssword field.
Help?
jk
Code:
nameInput =
new TextField(gameContainer, systemFont, LOGINTEXTX, LOGINTEXTY,
200, 50, new ComponentListener() {
public void componentActivated(BasicComponent arg0) {
nameInput.setFocus(false);
passwordInput.setFocus(true);
}
});
passwordInput =
new TextField(gameContainer, systemFont, LOGINTEXTX, LOGINTEXTY+70,
200, 50, new ComponentListener() {
public void componentActivated(BasicComponent arg0) {
passwordInput.setFocus(false);
nameInput.setFocus(true);
doLogin();
}
});