簡體   English   中英

如何將用戶名和密碼字段輸入Blackberry文本框?

[英]How do I get the username and password field into a Blackberry 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

此博客可幫助您創建用戶名和密碼文本框

如果從文件中獲取文本,則可以使用usernameField.getText()passwordField.getText()

TextField - 在用戶開始鍵入文本之前顯示提示

你可以嘗試這個鏈接。它會幫助制作盒子,但即使我一直在努力創建一個與你建議相同的東西。如果有人有更多的想法,我將非常感激。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM