📄 eatdot.java
字号:
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
public class Eatdot extends MIDlet
implements CommandListener
{
private Command exitCommand;
public Command startCommand;
public Command pauseCommand;
private Display display;
private MainCanvas myCanvas;
public Eatdot()
{
//System.out.println("debug 1");
display = Display.getDisplay(this);
exitCommand = new Command("Exit", Command.EXIT, 1);
//System.out.println("debug 2");
startCommand = new Command("Start", Command.OK, 1);
pauseCommand = new Command("Pause", Command.STOP, 1);
//System.out.println("debug 3");
}
public void startApp()
{
//System.out.println("debug 4");
myCanvas = new MainCanvas(startCommand, pauseCommand);
myCanvas.addCommand(exitCommand);
//System.out.println("debug 5");
myCanvas.setCommandListener(this);
//System.out.println("debug 6");
display.setCurrent(myCanvas);
//System.out.println("debug 7");
}
public void pauseApp()
{
}
public void destroyApp(boolean flag)
{
}
public void commandAction(Command command, Displayable displayable)
{
if(command == exitCommand)
{
destroyApp(false);
notifyDestroyed();
} else
if(command == startCommand)
myCanvas.resume();
else
myCanvas.pause();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -