Troubleshooting guide

15
1: Creating UIs
Create a screen
> Extend the Screen class or one of its subclasses, FullScreen or MainScreen.
Adding UI components to a screen
1. Create an instance of a UI component.
CheckboxField myCheckbox = new CheckboxField("First checkbox", true);
2. Add the UI component to your extension of a screen class.
mainScreen.add(myCheckbox);
Create UI components
To create an instance of a component, you can use more than one constructor. See the API Reference for more
information about
Field classes.
Task Steps
Create a pop-up screen. 1. Create an instance of a subclass of the Manager class.
Manager manageLayout = new
HorizontalFieldManager(VERTICAL_SCROLLBAR);
2. Create an instance of a PopupScreen using the Manager object.
PopupScreen popUp = new PopupScreen(manageLayout);
Add a bitmap. > Create an instance of a BitmapField.
BitmapField myBitmapField = new BitmapField();
Create a button. > Create an instance of a ButtonField using a style parameter.
ButtonField mySubmitButton = new ButtonField("Submit");
Create a numeric drop-down list > To create a drop-down list that contains numbers, create an instance of a
NumericChoiceField.
NumericChoiceField myNumericChoice = new NumericChoiceField( "Select
a number: ", 1, 20, 10);
Create a numeric drop-down list for a
large range of numbers.
> Create an instance of a GaugeField.
Create an alphanumeric drop-down list. > To create a drop-down list that contains objects, create an instance of an
ObjectChoiceField,providing an object array as a parameter.
String choiceItems[] = {"Option one", "Option two", "Option three"};
Create a check box. > Create an instance of a CheckboxField.
CheckboxField myCheckbox = new CheckboxField("First checkbox", true);