High-level UI components

Limited Connected Device User Interface (LCDUI) is the base of any Graphical User Interface (GUI) created in Java™ ME. It has a similar role to the Abstract Windowing Toolkit (AWT) and Swing APIs, which are used in Java SE and Java EE but offers a more restricted and resource-efficient approach to UI development.

LCDUI has a simple screen-based approach where a single Displayable is always active at a time in the display area of the application user interface. This Displayable can contain predefined screen elements, or be manipulated in more specific ways.

The high-level APIs are designed for applications that have client parts that run on mobile devices. For these applications, portability across devices is important. To achieve this portability, the high-level components employ a high level of abstraction and that provides a pre-defined look and feel. Generally high-level MIDlets employ common components with clearly defined features and most low-level applications feature some high-level parts, such as a main menu created with a List object.

All high-level APIs are derived from the Screen superclass. When a MIDlet utilises these classes, the actual implementation takes care of aspects such as drawing, fonts, and navigation. In other words, every Screen object provides presentation and layout for itself and MIDP applications that use high-level APIs define only the content. Screen classes map directly to native Series 40 and New Nokia Asha UI on Nokia Asha software platform 1.0 controls.

New line handling

The following table lists the line separators and the corresponding new line character combinations supported by LCDUI.

Line separator

New line escape in Java code

Unicode value

CR (Carriage Return)

\r

U+000D

CRLF (Carriage Return + Line Feed)

\r\n

U+000D, U+000A

LF (Line Feed)

\n

U+000A

LS (Line Separator, only in Unicode)

\u2028

U+2028

As a rule, each new line character combination results in exactly one forced line break when used in a String or character array that is displayed on the screen by a UI element. However, there are some exceptions when a new line character combination is not displayed as line break. The following sections describe these exceptions.

Command labels

In a Command label, each new line character combination is displayed as a box glyph (an empty rectangle).

Displayable

If there is only one line available for the title of a Displayable, any new line character combinations are displayed as white spaces (U+0020). If there are multiple lines available for the title, each new line character combinations forces a line break, unless the new line character combination is on the last available line, in which case it is displayed as a white space.

List and ChoiceGroup

If the fit policy of a ChoiceGroup or List is set to TEXT_WRAP_ON, each new line character combination in an element forces a line break in the displayed text. If the fit policy is set to TEXT_WRAP_OFF, the element text is limited to a single line and cropped if necessary. If the text contains a new line character combination in the first line, the text is cropped from the new line character combination onwards. The cropping is indicated by an ellipsis ("...").

Ticker

In a Ticker, each new line character combination is displayed as a white space on Series 40 devices.