Beruflich Dokumente
Kultur Dokumente
Contents
• 1 Overview
♦ 1.1 Introduction: Displayable
♦ 1.2 Event Handling -
Command Components
♦ 1.3 Screens and Item
Components
• 2 Other Links
Overview
The series MIDP's User Interface Hierarchy explores the MIDP's 2.0 user interface architecture and how to
use them. The MIDP 2.0 provides two packages regarding user interface: the javax.microedition.lcdui and
javax.microedition.lcdui.game packages. The former stands for liquid crystal display user interface (LCD UI)
and the other can be used to build wireless games.
Introduction: Displayable
The LCDUI is divided into two groups: the high level group and the low level group. For a better
understanding, let's consider the following figure, which depicts the UI component hierarchy of the high and
low level groups. First of all, we should have only one Display (javax.microedition.lcdui.Display) reference
per MIDlet in order to get screen information and request to display UI components in the screen. Each
MIDlet can have one or more Displayable (javax.microedition.lcdui.Displayable) components. Displayable
components can be a high or a low level component.
Overview 1
MIDP's_User_Interface_Hierarchy
The high level group belongs to the Screen (javax.microedition.lcdui.Screen) subgroup, which extends the
Displayable class:
The low level group belongs to the Canvas (javax.microedition.lcdui.Canvas) subgroup, which uses the
Graphics (javax.microedition.lcdui.Graphics) component to draw customized UI elements.
The process of getting and setting Displayables is through the Display API, which provides the following
methods described in table 1.
Introduction: Displayable 2
MIDP's_User_Interface_Hierarchy
For instance, if we would like to show a Screen or Canvas-based UI, we should get a Display reference before
setting it:
Display d = Display.getDisplay(midletReference);
d.setCurrent(screenOrCanvasReference);
The Item components can be added to a Form screen. All items extend the Item class. For instance, the
following class definition is the TextField item.
Finally, this first part of this series only gives an overview of all MIDP's LCDUI components and it's
hierarchy. The next part I will talk over about the first Screen-based component, called TextBox (MIDP's
User Interface Hierarchy: TextBox).
Other Links
• http://efforts.embedded.ufcg.edu.br/javame/
Other Links 4