开发者

popup window in blackberry

How c开发者_高级运维an I create a popup window when I click a button?


You can use a few different methods, status to inform the user (default 2 seconds display):

Status.show("Hello!");

Set your own display time:

Status.show("Hello!", 5000)

or a modal dialog:

Dialog.inform("Hello!");

a dialog with a response:

 int response = Dialog.ask(Dialog.D_YES_NO, "Continue?");
                switch (response) {
                    case Dialog.YES:
                        //do something
                    default:
                        //do nothing
                }

or for a full actual PopupScreen you create a popup class:

public class MyPopup extends PopupScreen{
public MyPopup() {
    super(new VerticalFieldManager(), Field.FOCUSABLE);
    add(new LabelField("Hello!"));
}

}

and push it to the stack like you would with a normal MainScreen class:

UiApplication.getUiApplication().pushScreen(new MyPopup());


have a look at these links,u can get ideas:

Blackberry: Create a popup Dialog

BlackBerry programing - create borderless popup screen

Moreover u can search stackoverflow to get more answers... :)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜