}
private void createUsernameBox() {
username = new NpTextBox();
username.setVisibleLength(25);
username.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(final KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
event.preventDefault();
password.selectAll();
password.setFocus(true);
}
}
});
password = new PasswordTextBox();
password.setVisibleLength(25);
password.addKeyPressHandler(GlobalKey.STOP_PROPAGATION);
password.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(final KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
event.preventDefault();
onLogin();