如何将用户名和密码字段放入文本框中?
usernameField = new EditField("USERNAME:", "");
passwordField = new PasswordEditField("PASSWORD:", "");
add(usernameField);
vm.add(new LabelField("\n"));
add(passwordField);
ButtonField buttonField_1 = new ButtonField( "Login",ButtonField.FIELD_HCENTER );
add( buttonField_1 );
ButtonField buttonField_2 = new ButtonField( "Forgot Password",ButtonField.FIELD_HCENTER );
add( buttonField_2 );
buttonField_1.setMargin(100, 10, 10, 10);
//popup1();
buttonField_1.setChangeListener( new FieldChangeListener() {
public void fieldChanged( Field arg0, int arg1 ) {
if (usernameField.getTextLength() == 0 || passwordField.getTextLength() == 0) {
Dialog.alert("You must enter a username and password");
} else {
profile();
}
}
});
buttonField_2.setChangeListener( new FieldChangeListener() {
public void fieldChanged( Field arg0, int arg1 ) {
UiApplication.getUiApplication().pushScreen(new Forgot_Pwd());
}
});