Blackberry JAVA DEVELOPMENT ENVIRONMENT Getting Started Manual - Page 21

Browse online or download pdf Getting Started Manual for Software Blackberry JAVA DEVELOPMENT ENVIRONMENT. Blackberry JAVA DEVELOPMENT ENVIRONMENT 32 pages. Version 4.7.0
Also for Blackberry JAVA DEVELOPMENT ENVIRONMENT: Release Note (8 pages)

Allow the CityInfo application set the values of UI fields with city information

>
In the constructor for the inner class, use a select clause to control the actions that the BlackBerry® device
application performs when a BlackBerry smartphone user selects a city from the menu of the BlackBerry
device application. Invoke
if (select == 0) {
lf.setText("Los Angeles");
popField.setText("3,694,820");
stateField.setText("California");
sightsField.setText("Hollywood");
} else if (select == 1) {
lf.setText("Chicago");
popField.setText("2,896,016");
stateField.setText("Illinois");
sightsField.setText("Blues Clubs");
} else if (select == 2) {
lf.setText("New York");
popField.setText("8,008,278");
stateField.setText("New York");
sightsField.setText("Broadway");
}
}//close the InfoScreen class code block
}//close the CityInfoScreenclass code block

Test the CityInfo Application in the BlackBerry Smartphone Simulator

1.
From the Run menu, click Run As > BlackBerry Simulator.
2. In the Choose a launch Configuration dialog box, select a launch configuration.
3. Press OK.
4. From the HomeScreen of the BlackBerry® Smartphone Simulator, select and open the CityInfo.
5. From the FullMenu of the BlackBerry device application, select a city.
6. From the FullMenu of the BlackBerry device application , select More Info.
7. From the FullMenu of the BlackBerry device application, select the Close menu item.
BasicEditField.setText()
}//close the constructor code block
2: Create a BlackBerry device application with advanced UI features
to set the text value of a
BasicEditField
.
21