Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Hello World Lab

by Retired ‎02-12-2010 11:45 AM - edited ‎09-17-2010 04:32 PM (7,025 Views)

Note: Before beginning these labs, you will need to download BlackBerry® Java® Development Environment tools.

 

Exercise

 

Write a basic application for a BlackBerry® device that displays the message "Hello World!" to users.

Objectives

  • Discover how to use the integrated development environment (IDE).
  • Discover how a BlackBerry application is organized.
  • Discover some of the basics of BlackBerry user interface APIs.

Setup

  1. Extract HelloWorld_incomplete.zip
  2. In the IDE, open the helloworld.jdw workspace
  3. Open the helloworld.java source file.

Tasks

  1. Add code to the main() method to start the application.
  2. Define a constructor for your application to display HelloWorldScreen.
  3. Add code to the HelloWorldScreen inner class to set the title for the screen, for example, "HelloWorld Sample".
  4. Add code to display the text "Hello World!"
  5. Add code to the onClose() method to display a dialog box with the text "Goodbye!" when the user closes your application.

Check Your Work

 

(In HelloWorld_complete.zip)

 

Review

In this exercise, you discovered the following things:

  • how to write, compile, and run applications in the IDE
  • how to start an application
  • how to create a screen and add a title and text fields to it
  • how to define an action when the user closes an application
Contributors
Users Online
Currently online: 31 members 2,450 guests
Please welcome our newest community members: