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

📄 pictureshowmidlet.java

📁 J2ME显示图片!利用一个简单的MIDlet就可以控制画布。
💻 JAVA
字号:
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;


public class PictureShowMIDlet extends MIDlet implements CommandListener {
	private Display display;
	public PictureShowMIDlet() {
		super();
	}

	protected void destroyApp(boolean arg0) throws MIDletStateChangeException {

	}

	protected void pauseApp() {
	}

	protected void startApp() throws MIDletStateChangeException {
		display = Display.getDisplay(this);
		PictureCanvas pc = new PictureCanvas();
		Command a = new Command("退出",Command.EXIT,1);
		pc.addCommand(a);
		pc.setCommandListener(this);
		pc.setFullScreenMode(true); 
		display.setCurrent(pc);
	}
	public void commandAction(Command c,Displayable s) {
		String cmd = c.getLabel();
		if(cmd.equals("退出")){
			try { 
				destroyApp(false); 
			} 
			catch(Exception e){e.printStackTrace();
    		}
			notifyDestroyed(); 
		}
	}
}

⌨️ 快捷键说明

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