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

📄 hello.java

📁 j2me的一个手机游戏
💻 JAVA
字号:
package net.frog_parrot.hello;

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

public class Hello extends MIDlet implements CommandListener
{
	HelloCanvas myCanvas;
	
	private Command exitCommand = new Command("Exit",Command.EXIT,99);
	private Command newCommand = new Command("Toggle Msg", Command.SCREEN,1);

	public Hello()
	{
		myCanvas = new HelloCanvas(Display.getDisplay(this));
		myCanvas.addCommand(exitCommand);
		myCanvas.addCommand(newCommand);
		myCanvas.setCommandListener(this);
	}

	public void startApp() throws MIDletStateChangeException
	{
		myCanvas.start();
	}

	public void destroyApp(boolean unconditional) throws MIDletStateChangeException
	{
			
	}

	public void pauseApp()
	{}

	public void commandAction(Command c,Displayable s)
	{
		if(c == newCommand)
		{
			myCanvas.newHello();
		}
		else if(c == exitCommand)
		{
		  try
		   {
			destroyApp(false);
			notifyDestroyed();
		   }catch(MIDletStateChangeException ex)  {}
		}
	}
}
























⌨️ 快捷键说明

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