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... :)
精彩评论