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

New Developer
Posts: 8
Registered: ‎08-22-2008
My Device: Not Specified
Accepted Solution

how to change the size of UI component



How can I change the size (width and height) of UI component?  For example, I want to set the width of a ListField and add a scroll bar (horizontal). Thanks.



BlackBerry Development Advisor
Posts: 15,871
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: how to change the size of UI component

The getPreferredWidth and getPreferredHeight methods can be overriden to change the requested dimensions of a field.


However, this doesn't mean that a field will support horizontal scrolling with only this change and may vary based on the field.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.