Tushar
Tushar

Reputation: 5935

BlackBerry non-wrapping LabelField

I have a label field and 3 edit fields. I want characters entered in the label field to be on one line. Can anybody tell me how to do this?

Upvotes: 0

Views: 562

Answers (1)

Tamar
Tamar

Reputation: 2066

You can check the length of the string using Font.getDefaultFont and call the function stringWidth passing in your label string. If the text is wider then the screen (use Display.getWidth), either make the font smaller or trim it to the size.

Another option is to implement your own field but that seems far more work... :)

Upvotes: 1

Related Questions