tags:

views:

34

answers:

2

How do I align elements right-to-left in a BlackBerry HorizontalFieldManager?

A: 

HorizontalFieldManager adds fields from left-to-right by default. In the following example, the three labels are aligned in one row from left to right.

HorizonatalFieldManager hManager=new HorizonatalFieldManager();

LabelField l1=new LabelField("Label1");
LabelField l2=new LabelField("Label2");
LabelField l3=new LabelField("Label3");

hManager.add(l1);
hManager.add(l2);
hManager.add(l3);
UserBB
sorry man, :( thats right to left, how?
udhaya
sorry(thats my mistake)
UserBB
+1  A: 

On JDE 6.0, if you want to do this for locale reasons, then setting the HorizontalFieldManager.LOCALE_AWARE_LAYOUT style bit will cause left-to-right or right-to-left, depending on the user's locale.

The HorizontalFieldManager docs for BlackBerry JDE 6.0 mention a style bit Field.LEFT_TO_RIGHT and Field.RIGHT_TO_LEFT, but I don't see those constants in Eclipse, so that may be a documentation bug.

Michael Donohue