Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Creating a user interface

Started 02-12-2010 by
Modified 09-17-2010 by

Exercise

 

Write an application for the BlackBerry® device that uses BlackBerry user interface (UI) components, such as drop-down lists.

 

Objectives

  • Discover how to use the IDE.
  • Discover how a BlackBerry application is organized.
  • Discover some of the basics of the BlackBerry user interface APIs.

Setup

 

  1. Extract CityInfo_Incomplete.zip
  2. In the IDE, open the cityinfo.jdw workspace
  3. Open the CityInfo.java source

Tasks

  1. In the CityInfoScreen constructor, add code to display a drop-down list with the following options: “Los Angeles”, “Chicago,” and “NewYork.”
  2. Add a More Info menu item that displays the InfoScreen.
  3. In the InfoScreen inner class, add code to display fields for population, state, and sight-seeing information.
  4. Add code to display information depending on the city that the user selected. (Tip: use the select variable that has already been defined).

Check Your Work

 

From CityInfo_Complete.zip

 

Review

 

In this exercise, you discovered the following things:

  • How to use an ObjectChoiceField to create a drop-down list
  • How to create custom menu items
  • How to add text to fields depending on a user selection
Contributors