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

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

New Contributor
Posts: 3
Registered: ‎08-08-2010
My Device: Bold 9700
Accepted Solution

GridFieldManager with label getting wider

I've searched the forums, but could not find the answer to my problem. so, who can help me out here.


I've got a GridFieldManager, with 2 labels containing static text, and two labels with text that I want to change during runtime.


GridFieldManager gfm = new GridFieldManager(2, 2, Manager.USE_ALL_WIDTH | GridFieldManager.FIXED_SIZE);
gfm.setColumnProperty(0, GridFieldManager.FIXED_SIZE, 300);
gfm.setColumnProperty(1, GridFieldManager.FIXED_SIZE, 180);
float TMeasured = 180 / 10;
float TSetpoint = 195 / 10;
lTemperatureMeasured = new LabelField(Float.toString(TMeasured) + "°c");
lTemperatureSetpoint = new LabelField(Float.toString(TSetpoint) + "°c");
gfm.add(new LabelField("Temperature measured"), FIELD_LEFT);
gfm.add(lTemperatureMeasured, FIELD_LEFT);//RIGHT);
gfm.add(new LabelField("Temperature setting"), FIELD_LEFT);
gfm.add(lTemperatureSetpoint, FIELD_LEFT);//RIGHT);



the problem is, that when I change the text of a label, the GridFieldManager gets wider! it just grows and grows by something like 5 pixels. changing the fixed widths did not help.

I just can't figure out why this happens. who does?


Changing the text is done with a button:



public void fieldChanged(Field field, int context)
    if(field == bChangeTemperature)



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

Re: GridFieldManager with label getting wider

This issue has been logged in Issue Tracker here:  https://www.blackberry.com/jira/browse/JAVAAPI-1341


Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
New Contributor
Posts: 2
Registered: ‎03-06-2009
My Device: Not Specified

Re: GridFieldManager with label getting wider

Just a note to say I found a solution/workaround for the GridFieldManager's growing field issue that at least worked for me.


After changes to the grid I call:




Maybe the padding values get changed incorrectly (and keep growing) and need to be reset???