examplegamecanvasmidlet.java

来自「J2ME的源码!我以前学习J2ME的源码哈!非常适合初学者」· Java 代码 · 共 46 行

JAVA
46
字号
package TestSprite;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class ExampleGameCanvasMIDlet extends MIDlet implements CommandListener{
	private ExampleGameSprite gameCanvas;
	//private Command exitcmd=new Command("Exit",Command.SCREEN,1);
	public ExampleGameCanvasMIDlet(){
		gameCanvas=new ExampleGameSprite();
		//gameCanvas.addCommand(exitcmd);
		//gameCanvas.setCommandListener(this);
		
	}

	protected void destroyApp(boolean arg0) {
		// TODO Auto-generated method stub

	}

	protected void pauseApp() {
		// TODO Auto-generated method stub

	}

	protected void startApp() throws MIDletStateChangeException {
		gameCanvas.start();
		Display.getDisplay(this).setCurrent(gameCanvas);
		

	}

	public void commandAction(Command c, Displayable d) {
		//if(c==exitcmd){
			//destroyApp(false);
			//notifyDestroyed();
		//}
		
	}

}

⌨️ 快捷键说明

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