January 2002
Intermediate to advanced
264 pages
8h 3m
English
javax.microedition.lcdui.Alert
This class implements an alert, which is an ordinary screen that can contain text and images and that handles events like other screens. The purpose of an alert is to inform the user about errors and other exceptional conditions.
The alert screen usually waits for a certain period of time before
proceeding to the next screen. Alternatively, the alert timer can be
set to infinity, using setTimeout(Alert.FOREVER).
In this case, the implementation allows the user to dismiss the
alert.
An alert may have a type (see the AlertType class)
that the implementation may use to play an appropriate sound when the
alert is presented to the user. To set the alert type, use
setType( ).
public classAlertextends Screen { // public class fields public static final intFOREVER= -2; // public constructors publicAlert(String title); publicAlert(String title, String alertText, Image image, AlertType alertType); // public instance methods public voidaddCommand(Command cmd); public intgetDefaultTimeout( ); public ImagegetImage( ); public StringgetString( ); public intgetTimeOut( ); public AlertTypegetType( ); public voidsetCommandListener(CommandListener l); public voidsetImage(Image image); public voidsetString(String str); public voidsetTimeout(int time); public voidsetType(AlertType type); }
Read now
Unlock full access