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 on April 1st. 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

Posts: 100
Registered: ‎06-21-2010
My Device: Not Specified
Accepted Solution

creating spaces between Fields

Hi All,


In my quest to develop a formScreen GUI, I have come up with this:





It looks a bit clumsy without spacing between each box..


Can anyone please tell me how to insert just small horizontal spacing between each of the boxes?








Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: creating spaces between Fields

If you check 6.0 documentation for Field, you will find setPadding(), setMargin() as well as all kinds of getPadding... and getMargin... methods.  Even though the documentation says there are available since 6.0.0, in fact there were there - undocumented but working - since probably 4.0.0 (when XYEdges became available).  I know for sure that they work in 4.2.1.  If you check the source code from this article


Implement advanced buttons, fields and managers


which states that it applies to BlackBerry 4.2.0 and later, you will find setPadding and setMargin there.


In fact, studying (not just using!) that source code is extremely useful for any serious BlackBerry UI developer. The code is not perfect (well, whose code is?), but it is much farther down the way of creating a likable UI than anything I have personally seen. You have setExtent (frequently seen here in the forums) and setVirtualExtent (very rarely used and explained though necessary for creating scrolling Managers) examples, all kinds of layoutChild and setPositionChild usage (the main building blocks for creating highly customized layouts) etc. - you name it, they have it.

please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!