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

📄 cb.java

📁 J2ME的游戏原代码!希望能帮助有需要帮助的师兄弟们!
💻 JAVA
字号:
// colorbugs
// coded by Tota



import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

 //Midp class
public class Cb extends MIDlet implements CommandListener {

	private Display display;
	private Command exit;
	private MyCanvas canvas;
   	private Command helpCommand;

   	/* Start	Addition		17-03-2003		for external events	*/
   	private boolean firstTime;
   	/* End		Addition		17-03-2003	*/

	public Cb(){
		display = Display.getDisplay(this);
		exit=new Command("Exit",Command.EXIT,1);
		helpCommand =new Command("Help",Command.SCREEN,2);
	}

	/*  start */
	public void startApp(){

	   	/* Start	Modified		17-03-2003		for external events	*/
		if(!firstTime){
			canvas=new MyCanvas();
			canvas.addCommand(exit);
			canvas.addCommand(helpCommand);
			canvas.setCommandListener(this);
			display.setCurrent(canvas);
			firstTime = true;
		}else {
			canvas.onoff = true;
		}
	   	/* End		Modified		17-03-2003	*/


	}

	public void pauseApp()
	{
		/* Start	Addition	20-03-2003	*/
		canvas.onoff = false;
		/* End		Addition	20-03-2003	*/
	}

		public void destroyApp(boolean unconditional)
	{
	}

	public void commandAction(Command c,Displayable s)
	{
		if (c==exit)
		{
			destroyApp(false);
			notifyDestroyed();
		}else if(c== helpCommand){
			/* Start	Modified		17-03-2003		for help text	*/
			Alert alert=new Alert("Help","Use the number keys to attract "+
							"bugs into the different spots.",
							null,AlertType.INFO);
			//Alert alert=new Alert("help","use number_keys to attract bugs into different spots",null,AlertType.INFO);
			/* End	Modified		17-03-2003	*/
			alert.setTimeout(Alert.FOREVER);
			display.setCurrent(alert);

		}
	}
}

⌨️ 快捷键说明

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