简体   繁体   English

如何将用户名和密码字段输入Blackberry文本框?

[英]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.

相关问题 如何在检查用户名和密码后从数据库中获取用户角色 - How do I get the user role from the database after it checks for its username and password 我如何让密码字段等于密码 123456 以及按钮“确定”在 java 中使用它 - How do i get the password field to be equal to the password 123456 and for the button “ok” to work with it in java 在 JDK 1.4 API 中,如何加密用户在文本框中输入的用户密码? - In JDK 1.4 API, how do I encrypt a user password that the user entered in a text box? 如何通过Maven输入私人用户名和密码进行测试? - How do I pull in a private username and password via Maven for testing? 如何搜索对象以查看其是否包含用户名和密码? - How do I search an object to see if it contains a username and password? 如何在api网址中传递用户名和密码 - How do i Pass username and password in an api url Compass + MongoDB:如何为特定数据库创建用户名和密码? - Compass + MongoDB: How do I create a username and password for a specific database? 如何在我的代码中修复密码/用户名身份验证? - How Do I fix the password/ username authentication in my code? 如何从 Android 的 SharedPreferences 获取用户名和密码? - How can I get username and password from SharedPreferences in Android? 如何向注册的用户名发送对话框 - How do I send a dialog box to a registered Username
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM