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
zinzinzan
Posts: 90
Registered: ‎04-03-2012
My Carrier: movilnet

LabelField with text placed on extreme right

hi there i wonder how put text in extreme right?? i need a LabelField with text in the extreme left ( default behavor )  and a number in the extreme right

Please use plain text.
Developer
peter_strange
Posts: 19,513
Registered: ‎07-14-2008

Re: LabelField with text placed on extreme right

Try this:

 

LabelField rightLabel = new LabelField("Text on right", LabelField.USE_ALL_WIDTH | DrawStyle.RIGHT);

 

Sorry coded from memory, might not be correct, but you get the idea.

 

The problem with this is that the LabelField is 'full width'.  The other option is this:

 

LabelField rightLabel = new LabelField("Text on right", LabelField.RIGHT);

 

This will draw on the right of the Manager into which it is put.  This can be a bit funny, it depends on the attributes of the Manager you add it to.  But if you add this to a VFM with style attribute (USE_ALL_WIDTH, it should work.

 

But I have not tested any of these.  I will test if you can't get this working. 

Please use plain text.
New Developer
saurabh0208
Posts: 10
Registered: ‎08-24-2012
My Carrier: Airtel

Re: LabelField with text placed on extreme right

Hi,

          u can an use style FIELD_RIGHT  and make it its manager use all width.This will solve the problem.

Please use plain text.