Name
javax.microedition.lcdui.Alert
Synopsis
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 classAlert
extends 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); }
Get Wireless Java now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.