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
Developer
ryansweny
Posts: 64
Registered: ‎07-15-2008
My Device: Z10
My Carrier: Rogers
Accepted Solution

Set the position of a PopupScreen

Is there a way to set the top, left position of a PopupScreen? Calling setPosition(x,y) will throw this error:

 

java.lang.IllegalStateException: setPosition called outside of layout

 

I'm using JDE 4.2.1, 8800 simulator.

 

thanks,

 

Ryan

 

 

Please use plain text.
Administrator
MSohm
Posts: 14,281
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Set the position of a PopupScreen

Quote from the previous forum:


 
ligraseac

Posts: 2
Registered: Jun, 2007

Popup screen position
Posted: Jun 29, 2007 5:45 AM
 
Hi,

how can i set the position of a popup screen? i want to set its position next to a field that have the focus.

Thanks

 


Guest: fjarlier
Re: Popup screen position
Posted: Jul 5, 2007 5:10 PM
 
Hi,

In your class that extends PopupScreen you must override sublayout like that:

public void sublayout(int width, int height){

super.sublayout(width,height);
setPosition(50,50);
}

Because the setPosition can only occurs in the layout method. And then you can position your PopupScreen anywhere you want.

For me it works...

If you have another solution I take it.

So long

fred

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.