ErrorScreen.java
资源名称:J2ME&Game.rar [点击查看]
上传用户:gyyuli
上传日期:2013-07-09
资源大小:3050k
文件大小:1k
源码类别:
J2ME
开发平台:
Java
- import javax.microedition.lcdui.*;
- class ErrorScreen extends Alert
- {
- private static Image image;
- private static Display display;
- private static ErrorScreen instance = null;
- private ErrorScreen()
- {
- super("Error");
- setType(AlertType.ERROR);
- setTimeout(5000);
- setImage(image);
- }
- static void init(Image img, Display disp)
- {
- image = img;
- display = disp;
- }
- static void showError(String message, Displayable next)
- {
- if (instance == null)
- {
- instance = new ErrorScreen();
- }
- instance.setTitle("Error");
- instance.setString(message);
- display.setCurrent(instance, next);
- }
- }