Blackberry JAVA DEVELOPMENT ENVIRONMENT Podręcznik dla początkujących - Strona 22

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
Code sample: A BlackBerry device application that displays information on a
city the user selects
/**
Example:
* CityInfo.java
* Copyright (C) 2001-2008 Research In Motion Limited. All rights reserved.
*/
package com.rim.samples.cityinfo;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;
import net.rim.device.api.i18n.*;
public class CityInfo extends UiApplication
{
public static void main(String[] args)
{
//Create a new instance of the BlackBerry
//and start the BlackBerry device application on the event thread.
CityInfo app = new CityInfo();
app.enterEventDispatcher();
}
public CityInfo()
{
//Display a new screen.
pushScreen(new CityInfoScreen());
}
}
//Create a new screen that extends MainScreen and provides
//behaviour similar to that of other BlackBerry device applications.
final class CityInfoScreen extends MainScreen
{
//declare variables for later use
private
InfoScreen
private ObjectChoiceField choiceField;
private int select;
public CityInfoScreen()
{
//Invoke the MainScreen constructor.
super();
//Add a screen title.
LabelField title = new LabelField("City Information Kiosk",
setTitle(title);
//Add a text label.
add(new RichTextField("Major U.S. Cities"));
//Add a drop-down list with the names of three cities as choice items:
22
_infoScreen;
LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
device application
®