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
Regular Contributor
sreid
Posts: 69
Registered: ‎07-18-2011
My Device: 9630 Tour
Accepted Solution

How to position ListField or ObjectListField

[ Edited ]

Does anyone know how to set the x,y position of a ListField or ObjectListField?

 

I am testing on  the Blackberry 9700 ATT simulator, running OS 5.0.

 

I am trying to use an ObjectListField to create subMenu's in OS 5.0 and I have set the width using getPreferredWidth() so that it doesn't occupy the entire screen. So it's beginning to look like a system menu, but it's default x,y position is at 0,0 and I need to change that.

 

 

Thanks,

Steve

Developer
BeroboInc
Posts: 123
Registered: ‎07-08-2011
My Device: Torch 9800, Bold 9700

Re: How to position ListField or ObjectListField

setMargin works great for this.

 

You can use it like this

 

myfield.setMargin(y, 0, 0, x); // top, right, bottom, left

Berobo Inc.
Police Scanner Radio / Alarm Clock lets you listen to Police scanners in your area!
http://www.berobo.com
_________________________________________________
Please click the Like button to thank the user that has helped you and
please mark post as solved when you have found the solution to your problem.
Regular Contributor
sreid
Posts: 69
Registered: ‎07-18-2011
My Device: 9630 Tour

Re: How to position ListField or ObjectListField

Thanks BeroboInc,

 

that did the trick, I wonder why Blackberry doesn't have a setPosition() method where you specify just x,y coordinates? Anyway, I'm glad it works.

 

Thanks again,

Steve