开发者

text field in a dialog box on a BlackBerry

开发者 https://www.devze.com 2023-01-22 08:59 出处:网络
I want to create an empty dialog box with a text field inside. When the user enters data inside the box he must be redirected to another scr开发者_如何学Ceen. I want the Dialog box to come up without

I want to create an empty dialog box with a text field inside. When the user enters data inside the box he must be redirected to another scr开发者_如何学Ceen. I want the Dialog box to come up without any statements but must include a textfield


That should be doable with a PopupScreen, EditField and maybe a ButtonField so the user can let you know he/she is done entering data.


Just create standard OK dialog and then add an EditField to it.

BasicEditField inputField = new BasicEditField();                     

Dialog d = new Dialog(Dialog.D_OK_CANCEL, "Enter your Username:", Dialog.OK, null, Dialog.DEFAULT_CLOSE);
d.add(inputField);     

int i = d.doModal();

if (i == Dialog.OK) {
    Dialog.inform("Your Username is : " + inputField.getText());
}

Here's a complete tutorial

0

精彩评论

暂无评论...
验证码 换一张
取 消