Blackberry JAVA DEVELOPMENT ENVIRONMENT Podręcznik dla początkujących - Strona 20
Przeglądaj online lub pobierz pdf Podręcznik dla początkujących dla Oprogramowanie Blackberry JAVA DEVELOPMENT ENVIRONMENT. Blackberry JAVA DEVELOPMENT ENVIRONMENT 32 stron. Version 4.7.0
Również dla Blackberry JAVA DEVELOPMENT ENVIRONMENT: Uwaga dotycząca wydania (8 strony)
Getting started guide
CityInfoScreen
>
In the
protected void makeMenu(Menu menu,int instance)
{ menu.add(_viewItem);
menu.add(_closeItem);
}
Create a screen that displays information about a city
1.
Within the
CityInfoScreen
private class InfoScreen extends MainScreen
{
2. In the first line of the constructor for the inner class, invoke the constructor of the
super();
3. To display a label with the name of the city the BlackBerry® smartphone user selects, in the constructor for
the inner class, create a
LabelField lf = new LabelField();
4. To display the population of the city the BlackBerry smartphone user selects, in the constructor for the inner
class, create a
BasicEditField
BasicEditField popField = new BasicEditField("Population: ", null, 20, Field.READONLY);
5. To display the state that the city the BlackBerry smartphone user selects is located in, in the constructor for
the inner class, create a
BasicEditField stateField = new BasicEditField("State: ", null, 20, Field.READONLY);
6. To display tourist attraction information for the city the BlackBerry smartphone user selects, in the
constructor for the inner class, create a
BasicEditField sightsField = new BasicEditField("Sights: ", null, 50, Field.READONLY);
To add fields to the
Manager.add()
invoke
add(lf);
add(new SeparatorField());
add(popField);
add(stateField);
add(sightsField);
A
BasicEditField
Reference for more information.
20
makeMenu()
class, override the
class, create an inner class that extends
LabelField
.
. A
BasicEditField
BasicEditField
.
BasicEditField
Manager
object for the
CityInfoScreen
.
is an editable simple text field with no formatting. See
method.
MainScreen
is an editable simple text field with no formatting.
.
class, in the constructor for the inner class,
BasicEditField
.
MainScreen
class.
in the API