Troubleshooting guide

14
BlackBerry Java Development Environment Development Guide
Types of screens
How the JVM manages screens
The JVM maintains Screen objects in a display stack, which is an ordered set of Screen objects. The screen at the
top of the stack is the active screen that the BlackBerry® device user sees. When an application displays a screen,
it pushes the screen to the top of the stack. When an application closes a screen, it removes the screen off the top
of the stack and displays the next screen on the stack, redrawing it as necessary. Each screen can appear only
once in the display stack. The JVM throws a runtime exception if a
Screen that the application pushes to the stack
already exists. Applications must remove screens from the display stack when the BlackBerry device user finishes
interacting with them so that the application uses memory efficiently. Use only a few modal screens at one time,
because each screen uses a separate thread.
UI components
Fields represent all UI components, which are rectangular regions that a Manager contains. A field’s layout
requirements determine the size of the field. Managers provide scrolling for the fields that they contain.
To create a specialized field component (such as a text field that contains multiple elements), create your own
custom types by extending the
Field class or one of its subclasses.
Screen Type Class Description
Default 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.
Standard
vertical
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.
BlackBerry
style
MainScreen
The MainScreen class provides features that are common to standard BlackBerry® applications. Use a
MainScreen object for the first screen of your application to maintain consistency with other BlackBerry
applications. The
MainScreen class provides the following UI components:
default position of a screen title, with a SeparatorField after the title
main scrollable section contained in a VerticalFieldManager
default menu with a Close menu item
default close action when the BlackBerry device user clicks the Close menu item or presses the Escape
key
Traditional field BlackBerry field
Button
ButtonField
Check box
CheckboxField
Date
DateField
Dialog box
PopupScreen
Drop-down list
NumericChoiceField or ObjectChoiceField
Option
RadioButtonField
Text
RichTextField, BasicEditField, EditField,PasswordEditField, or
AutoTextEditField.
Text label
LabelField
List
ListField