CheckboxField myCheckbox = new CheckboxField("First checkbox", true);
3.
Add the UI component to your extension of a
Screen
class.
mainScreen.add(myCheckbox);
Create a dialog box
1.
Import the following classes:
•
net.rim.device.api.ui.Manager
•
net.rim.device.api.ui.container.HorizontalFieldManager
•
net.rim.device.api.ui.container.PopupScreen
2.
Create an instance of a subclass of the
Manager
class.
Manager manageLayout = new HorizontalFieldManager( VERTICAL_SCROLLBAR);
3.
Create an instance of a
PopupScreen
using the
Manager
object.
PopupScreen popUp = new PopupScreen(manageLayout);
Creat a bitmap
1.
Import the
net.rim.device.api.ui.component.BitmapField
class.
2.
Create an instance of a
BitmapField
.
BitmapField myBitmapField = new BitmapField();
Create a button
1.
Import the
net.rim.device.api.ui.component.ButtonField
class.
2.
Create an instance of a
ButtonField
using a style parameter.
ButtonField mySubmitButton = new ButtonField("Submit");
Create a list
Create an alphanumeric drop-down list
1.
Import the following classes:
•
java.lang.String
•
net.rim.device.api.ui.component.ObjectChoiceField
•
net.rim.device.api.ui.container.MainScreen
2.
Create an instance of an
ObjectChoiceField
, providing an object array as a parameter to create a drop-down list
that contains objects.
Development Guide
UI components
16