How to create a custom Label field that works similar to default LabelField issues : it should be able to take large texts and should be able to display them in different lines if the length exceeds the screen width.
Asked
Active
Viewed 1,307 times
1 Answers
0
The existing LabelField class already displays text on a different line if the length exceeds the screen width. To increase the font size do something like this:
label.setFont(Font.getDefault().derive(Font.PLAIN, 18, Ui.UNITS_pt));

Jonathan
- 1,735
- 11
- 17
-
I think My question was not clear to you ? I will make it a bit clearer . I want to create a custom Label field so that I can pass some extra arguments to it together with the label field text . for doing show I am crating a custom label field that is extending label field .but this custom label field is not taking the default property of the label field i.e if the length of the label text exceeds the screen width it is not shifting the remaining texts to the next line . – Vivek Giri Jan 06 '11 at 11:30
-
If you replace your custom labelfield with a regular labelfield does the text go to the next line? If not then it's probably a problem with your manager. Otherwise it's probably a problem with your LabelField code, which methods are you overriding? – Jonathan Jan 06 '11 at 13:19
-
I am adding the custom label field to a vertical field manager so there is no problem with the manager. actually in my customlabel field I need to set extent of my of the field I think that is causing the problem. – Vivek Giri Jan 07 '11 at 09:39
-
That probably is your problem. I can't help you any more than that without seeing your LabelField code. – Jonathan Jan 07 '11 at 19:09
-
K thanks Jonathan, I got an alternate way to implement my requirement and is now working fine. – Vivek Giri Jan 08 '11 at 07:10
-
Hey Jonathan can u help me with another problem ..... In my Blackberry Application I want to set alarm at a particular date in a particular time with a reminder text eg "2011-01-26 at 11 pm "Go to Office""..... – Vivek Giri Jan 08 '11 at 07:13