ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button

MIDP GUI Programming, Part 1
Pages: 1, 2

The lcdui Package

All MIDP GUI classes are contained in the javax.microedition.lcdui package. This package contains three interfaces and twenty-one classes, as shown in Table 1 and Table 2.

Table 5-1: lcdui interfaces

Interface

Description

Choice

Defines an API for a user interface component that implements a selection from a predefined number of choices

CommandListener

Used by applications that need to receive high-level events from implementations

ItemStateListener

Used by applications that need to receive events that indicate changes in the internal state of the interactive items


Table 2: lcdui classes

Class

Description

Alert

A screen that shows data to the user and waits for a certain period of time before proceeding to the next screen.

AlertType

A utility class that indicates the nature of the alert.

Canvas

The base class for writing applications that need to handle low-level events and to issue graphics calls for drawing to the display.

ChoiceGroup

A group of selectable elements intended to be placed within a Form.

Command

A construct that encapsulates the semantic information of an action.

DateField

An editable component for presenting calendar data and time information that may be placed into a Form.

Display

A utility that represents the manager of the display and input devices of the system.

Displayable

An object that has the capability of being placed on the display.

Font

A utility that represents font and font metrics.

Form

A screen that contains an arbitrary mixture of items (images, text, text fields, or choice groups, for instance).

Gauge

A utility that implements a bar graph display of a value intended for use in a form.

Graphics

A utility that provides a simple two-dimensional geometric rendering capability.

Image

A utility that holds graphical image data.

ImageItem

A utility that provides layout control when Image objects are added to a form or alert.

Item

A superclass for all components that can be added to a Form or Alert.

List

A screen containing a list of choices.

Screen

The superclass of all high-level user interface classes.

StringItem

An item that can contain a String.

TextBox

A screen that allows the user to enter and edit text.

TextField

An editable text component that can be placed into a Form.

Ticker

A ticker-type piece of text that runs continuously across the display. It can be attached to all screen types except Canvas.

The class diagram in Figure 4 shows the major classes and the relationships between them.

Diagram.
Figure 4. Class diagram of the major classes in the lcdui package.

Next week, we continue exploring the wireless Java MIDP GUI API by focusing on the High-Level MIDP APIs


View catalog information for Learning Wireless Java


Return to ONJava.com.