Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 42
Registered: ‎10-23-2011
My Device: curve 8520
My Carrier: george najem

How do you make a button open another window?

How do you make a button open another window?

 

Thanks in advance

Highlighted
Developer
Posts: 40
Registered: ‎09-08-2011
My Device: 8900
My Carrier: AIS

Re: How do you make a button open another window?

There's no such thing as a "window".

 

You should probably look at some "pushScreen" examples.

Developer
Posts: 228
Registered: ‎10-01-2011
My Device: Passport

Re: How do you make a button open another window?

Create a button:

 

ButtonField btnOk = new ButtonField("OK", ButtonField.CONSUME_CLICK | Field.FIELD_CENTER);

btnOK = setMinimalWidth(150);

 

Attach the command handler:

 

btnOk.setCommand(new Command(new CommandHandler()
{
            public void execute(ReadOnlyCommandMetadata metadata, Object context)
            {
                     UiApplication.getUiApplication().pushScreen(new MyScreen());
           }
}));

 

add(btnOK);

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How do you make a button open another window?

Or, if you are not working in OS 6.0 yet, use a FieldChangedListener to do the same thing.