I need to align a CheckboxField to the right of a fixed text (on Blackberry) like the "manage connections" dialog. The code is:
final HorizontalFieldManager hfm = new HorizontalFieldManager(USE_ALL_WIDTH);
hfm.add(new LabelField("Test me please", LabelField.ELLIPSIS | FIELD_LEFT | FIELD_VCENTER | USE_ALL_WIDTH));
cbx = new CheckboxField(null, false, FIELD_RIGHT | CheckboxField.NO_USE_ALL_WIDTH);
hfm.add(cbx);
I tried various combinations of "USE_ALL_WIDTH", "NO_USE_ALL_WIDTH" and similar flags, but I still can't get what I want: text all the way to the left, and check box all the way to the right. If the label is set to USE_ALL_WIDTH, the checkbox disappears, and if it's not set, the checkbox is displayed near the text (not on the right side of the hfm).
Use following code,this will solve your problem.