Jump to: navigation, search

BlackBerry Concepts

2,119 bytes added, 13:54, 22 February 2011
BlackBerry Development Fundamentals using Eclipse IDE
=== Procedure to add UI Elements to Application ===
{| class="wikitable" border="0" cellpadding="6"
! Steps !! Actions
| [[File:12bb.png|left|600px]] || <source lang="java">
* Creates a new HelloWorldScreen object
HelloWorldScreen() {
// Set the displayed title of the screen
setTitle("Eclipse Course");
// Add a read only text field (RichTextField) to the screen. The
// RichTextField is focusable by default. Here we provide a style
// parameter to make the field non-focusable.
add(new RichTextField("Welcome to BlackBerry World!",
| [[File:13bb.png|left|600px]] || [ Dialog]
Provides a dialog box with predefined configurations.
To get a standard, predefined dialog use
* Dialog.alert(java.lang.String)
** This method creates an alert dialog typically used to notify the user of an event or some important information. The dialog uses a exclamation mark bitmap.
* Dialog.ask(int)
** This method creates a standard inquiry dialog. The dialog uses a question mark bitmap.Creates a standard inquiry dialog.
* Dialog.inform(java.lang.String).
** Creates a notification dialog with the specified message. This method creates a notification dialog displaying the specified message. The dialog uses the "information" bitmap.
These pop up a predefined dialog and wait for user input. To get a more customized dialog, instantiate this class or extend it.
Pressing ESCAPE returns Dialog.CANCEL, but only if it was one of the choices specified in the values array.
| [[File:14bb.png|left|600px]] || <source lang="java">
* Displays a dialog box to the user with the text "Goodbye!" when the
* application is closed.
* @see net.rim.device.api.ui.Screen#close()
public void close() {
// Display a farewell message before closing the application

Navigation menu