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
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:

 

2992i635FCA478B696F05

 

 

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?

 

Thanks


Dan

 

 

 

 

Highlighted
Developer
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!