[英]How do I get the username and password field into a Blackberry Text Box?
How do I get the username and password field into a text box? 如何在文本框中输入用户名和密码字段?
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());
}
});
http://keraisureshvblackberry.blogspot.in/2012/02/on-last-post-we-have-study-lablefiled.html http://keraisureshvblackberry.blogspot.in/2012/02/on-last-post-we-have-study-lablefiled.html
This blog is help to you for create username and password textbox 此博客可帮助您创建用户名和密码文本框
if you getting text from filed than you can use usernameField.getText() and passwordField.getText() 如果从文件中获取文本,则可以使用usernameField.getText()和passwordField.getText()
TextField - show hint before user starts typing text TextField - 在用户开始键入文本之前显示提示
You can try that link.It'll aid to make boxes but even i've been struggling trying to create one same as ur suggesting.If anyone has some more ideas,it would be much appreciated. 你可以尝试这个链接。它会帮助制作盒子,但即使我一直在努力创建一个与你建议相同的东西。如果有人有更多的想法,我将非常感激。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.