⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 waitting.java

📁 手机的联网应用
💻 JAVA
字号:
package cn.com.javachen;

import java.io.IOException;

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

public class Waitting extends Canvas implements Runnable ,CommandListener{
	private final Thread alertThread;
	private boolean bool;
	private Image image;
private Command exitCommand;
private Displayable next;
private HomeReceiveMidelt hr;
	public Waitting(boolean bool,HomeReceiveMidelt hr,Displayable next) {
		super();
		// TODO 自动生成构造函数存根
		this.hr=hr;
		this.bool = bool;
		this.next=next;
		exitCommand= new Command("返回", Command.BACK, 1);
		this.addCommand(exitCommand);
		setCommandListener(this);
		alertThread = new Thread();
		alertThread.start();
		try {
			image=Image.createImage("/res/wait.png");
		} catch (IOException e) {
			// TODO 自动生成 catch 块
			e.printStackTrace();
		}

	}

	protected void paint(Graphics g) {
		// TODO 自动生成方法存根
		 g.setColor(0x00FFFFFF);    
		    g.fillRect(0, 0, getWidth(), getHeight());
		    g.setColor(0x00000000);        
		    g.drawImage(image, getWidth() / 2, getHeight() / 2 - 5, 3);
	}

	public void run() {
		// TODO 自动生成方法存根
		if (bool) {
			repaint();			
		} else{			
			Display.getDisplay(hr).setCurrent(next);
		}
	}

	public void exit() {
		// TODO 自动生成方法存根
		bool = false;
	}

	public void commandAction(Command arg0, Displayable arg1) {
		// TODO 自动生成方法存根		
		if(arg0==exitCommand){
//						try {
//							hr.destroyApp(true);
//						} catch (MIDletStateChangeException e) {
//							// TODO 自动生成 catch 块
//							e.printStackTrace();
//						}
			hr.mainMenuScreenShow(null);
			
		}
		
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -