Troubleshooting guide
16
BlackBerry Java Development Environment Development Guide
Create an option. 1. Create an instance of a RadioButtonGroup().
RadioButtonGroup rbGroup = new RadioButtonGroup();
2. Create an instance of a RadioButtonField for each option you want to make available to the
BlackBerry® device user.
RadioButtonField rbField = new RadioButtonField("First field");
RadioButtonField rbField2 = new RadioButtonField("Second field");
3. Invoke RadioButtonGroup.add() to add the RadioButtonFields to the
RadioButonGroup and make sure the BlackBerry device user can select only one option at a
time.
rbGroup.add(rbField);
rbGroup.add(rbField2);
Create a date field. > Create an instance of a DateField, providing the value returned by
System.currentTimeMillis() as a parameter to return the current time.
DateField dateField = new DateField("Date: ",
System.currentTimeMillis(), DateField.DATE_TIME);
Create a read-only field that you can
format using different fonts and styles.
> Create an instance of a RichTextField .
RichTextField rich = new RichTextField("RichTextField");
Create an editable text field that
contains no default formatting but
accepts filters.
> Create an instance of a BasicEditField.
BasicEditField bf = new BasicEditField("BasicEditField: ", "", 10,
EditField.FILTER_UPPERCASE);
Create an editable text field that lets
BlackBerry device users access special
characters.
> Create an instance of an EditField.
EditField edit = new EditField("EditField: ", "", 10,
EditField.FILTER_DEFAULT);
Create a password field. > Create an instance of a PasswordEditField.
For example, the following instance uses a constructor that lets you provide a default initial
value for the
PasswordEditField.
PasswordEditField pwd = new PasswordEditField("PasswordEditField: ",
"");
Create an AutoText edit field. > Create an instance of an AutoTextEditField.
AutoTextEditField autoT = new AutoTextEditField("AutoTextEditField: ",
"");
Some filters render some AutoText entries ineffective. For example, FILTER_LOWERCASE
renders an AutoText entry that contains capitalization ineffective.
Create a field that displays a progress
bar for the numbers that the BlackBerry
device user selects.
> Create an instance of a GaugeField.
GaugeField percentGauge = new GaugeField("Percent: ", 1, 100, 29,
GaugeField.PERCENT)
Create a text label. > Create an instance of a LableField to add a text label to a screen.
LabelField title = new LabelField("UI Component Sample",
LabelField.ELLIPSIS));
Task Steps