test.java

来自「j2me的框架~~本人在学习中总结出来的」· Java 代码 · 共 47 行

JAVA
47
字号
import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import java.lang.Thread;
import javax.microedition.midlet.MIDletStateChangeException;


public class Test extends MIDlet {
	
	private TestCanvas theGame;
	private Display dis;
	

	public Test() {
		 
		theGame=new TestCanvas();
		
	}

	protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
		 

	}

	protected void pauseApp() {
		 

	}

	protected void startApp() throws MIDletStateChangeException {
		 

		System.out.println("启动");
		dis=Display.getDisplay(this);
		dis.setCurrent(theGame);
		
		try{
			
			Thread myThread=new Thread(theGame);
			myThread.start();
			
		}catch(Exception ex){
			
		}
	}

}

⌨️ 快捷键说明

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