Creating user interfaces
1
Screens
The main structure for a BlackBerry® device user interface is the
Screen
object. A BlackBerry Java® Application may display
more than one screen at a time, but only one screen in a BlackBerry Java Application is active at one time.
The user interface APIs initialize simple
Screen
objects. Once you create a screen, you can add fields and a menu to the screen
and display it to the BlackBerry device user by pushing it on to the UI stack. The menu object has associated menu items that
are runnable objects, which perform a specific task when the BlackBerry device user selects one of the items. For example, menu
items may invoke the necessary code to establish a network connection, commit a data object to memory or close the BlackBerry
Java Application. For a more sophisticated custom BlackBerry Java Application, you can customize the BlackBerry device user
interface and implement new field types, as required. You can also add custom navigation and trackwheel behavior.
The
Screen
class does not implement disambiguation, which is required for complex input methods, such as international
keyboards. For seamless integration of the different input methods, extend
Field
or one of its subclasses. Do not use
Screen
objects for typing text.
For knowledge base articles about displaying and working with screens, visit the BlackBerry Developer Zone at
www.blackberry.com/developers
.
Screen classes
Class
Description
Screen
Use the
Screen
class to define a manager to lay out UI components on the screen
and to define a specific type of screen using the styles that the constants on the
Field
superclass define.
FullScreen
By default, a
FullScreen
class contains a single vertical field manager. Use a
FullScreen
class to provide an empty screen that you can add UI components
to in a standard vertical layout. For another layout style, such as horizontal or
diagonal, use a
Screen
class and add a
Manager
to it.
MainScreen
The
MainScreen
class provides features that are common to standard
BlackBerry® Java® Applications. Use a
MainScreen
object for the first screen
of your BlackBerry Java Application to maintain consistency with other BlackBerry
Java Applications. The
MainScreen
class provides the following UI components:
•
default position of a screen title, with a
SeparatorField
after the title
Development Guide
Creating user interfaces
7