123
123

Reputation:

popup window in blackberry

How can I create a popup window when I click a button?

Upvotes: 2

Views: 3512

Answers (2)

Jonathan Fisher
Jonathan Fisher

Reputation: 380

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());

Upvotes: 10

Swati
Swati

Reputation: 2918

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... :)

Upvotes: 1

Related Questions