tales.java

来自「一个RPG的JAVA游戏」· Java 代码 · 共 47 行

JAVA
47
字号
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class Tales extends MIDlet
	implements CommandListener
{

	private Command exitCommand;
	private SFCanvas sfcan;

	public Tales()
	{
		exitCommand = new Command("Exit", 7, 1);
		SFCanvas sfcanvas = new SFCanvas();
		sfcanvas.addCommand(exitCommand);
		sfcanvas.setCommandListener(this);
		Display.getDisplay(this).setCurrent(sfcanvas);
	}

	protected void startApp()
		throws MIDletStateChangeException
	{
	}

	protected void pauseApp()
	{
		try
		{
			sfcan.thread.wait();
		}
		catch (Exception exception) { }
	}

	protected void destroyApp(boolean flag)
		throws MIDletStateChangeException
	{
		sfcan = null;
	}

	public void commandAction(Command command, Displayable displayable)
	{
		if (command == exitCommand)
			notifyDestroyed();
	}
}

⌨️ 快捷键说明

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