BlackBerry API 6.0. How to make a LabelField wider (to make it stop enforcing new lines)?

288 Views Asked by At

I have a class which extends LabelField to set font and color. I have 2 such custom LabelFields and they display some strings of text. Those Strings are rather short, about a dozen symbols long.

The problem is that these custom LabelFields enforce new lines. They break my strings and display them in 2 lines instead of only 1 (no matter if a String is 6 or 12 characters long).

How to make these LabelFields stop enforcing new lines? I need to have one line stay one line.

Update: I have found the reason of that problem. The problem was on another level, - in the process of calculation of width and height for my popup Screen which contained those LabelFields.

1

There are 1 best solutions below

2
On
you can use the style LabelField.ELLIPSIS to force the single line.

like

LabelField l = new LabelField("your text",LabelField.ELLIPSIS);