Blackberry JAVA DEVELOPMENT ENVIRONMENT Handbuch "Erste Schritte - Seite 22
Blättern Sie online oder laden Sie pdf Handbuch "Erste Schritte für Software Blackberry JAVA DEVELOPMENT ENVIRONMENT herunter. Blackberry JAVA DEVELOPMENT ENVIRONMENT 32 Seiten. Version 4.7.0
Auch für Blackberry JAVA DEVELOPMENT ENVIRONMENT: Freigabemitteilung (8 seiten)
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
®