This is what i m do. What is wrong?
public Login() {
.....
signInButton = new Button();
signInButton.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
if (textBoxUsername.getText().length() == 0 ||
textBoxPassword.getText().length() == 0) {
Window.alert("Username or password is
empty.");
}
else
// do something
}
});
signInButton.addKeyboardListener(new KeyboardListenerAdapter() {
public void onKeyPress(Widget sender, char keyCode, int
modifiers)
{
if(keyCode == KEY_ENTER) {
if (textBoxUsername.getText().length() == 0 ||
textBoxPassword.getText().length() == 0) {
Window.alert("Username or password is
empty.");
}
else
// do something
}
}
});
signInButton.setText("Sign In");
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---