i have large data in label field and using FOCUSABLE on it makes the whole data selected at once.Scrolling down focus goes to next LabelField.Is ther a way to move on text of LabelField line by line
Eg: my label field is
String tenlines="line
line 2...
line10"
LabelField f= new LabelField(tenlines);
You can use RichTextField
String tenlines="line
line 2...
line10";
RichTextField detailField = new RichTextField(tenlines)
Related
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.
you can use the style LabelField.ELLIPSIS to force the single line.
like
LabelField l = new LabelField("your text",LabelField.ELLIPSIS);
I want to add multiple strings in the LabelField or RichTextField in my application. So that i'm able to control the font size of both the strings and also i'm able to click on this row to navigate.
eg.
Title
date
You can use RichTextField to have multiple strings with multiple fonts. Check the RichTextField class in the APIs
http://www.blackberry.com/developers/docs/3.7api/net/rim/device/api/ui/component/RichTextField.html
I've add some customized buttonfield follow by some label field.
When opening the app, the first buttonfield gets focus, but I don't need the focus when opening the screen. How to avoid the focus on opening the screen?
use NullField like the code below:
NullField field = new NullField();
field.setFocus();
This will avoid the focus on any field in the screen
I want to create the EditField which allow Numeric Values, Comma and other values are ignore in Blackberry.
So How I can achieve this by programming code ?
Thanks.
It can be achieved by using the EditField class with the Four arguments according to your need.
EditField ef = new EditField(0, "0", 3, EditField.FILTER_NUMERIC)
Add this field to a screen or a manager
The above code would make the field accept only the integer values. And if it is a Virtual keypad, it would not even show other characters/aplhabets on the keypad
Hope this solves your problem.
Keep Coding
Cheers !!
use filter for this.....
_numberEditField = new EditField(_name, "");
_numberEditField.setFilter(TextFilter.get(TextFilter.NUMERIC));
add(_numberEditField);
How can I place a RichTextField and a button in a single line
Place them both in a HorizontalFieldManager.