📄 m3gmidlet.java
字号:
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 M3GMidlet extends MIDlet implements CommandListener
{
private Display display = null;
// 定义3D画布
private M3GCanvas canvas = null;
private static MIDlet self = null;
protected void startApp() throws MIDletStateChangeException
{
display = Display.getDisplay(this);
canvas = new M3GCanvas(30);
canvas.addCommand(new Command("Quit", Command.EXIT, 1));
canvas.setCommandListener(this);
//调用绘制的启动方法
canvas.start();
display.setCurrent(canvas);
self = this;
}
protected void pauseApp()
{
}
protected void destroyApp(boolean unconditional) throws MIDletStateChangeException
{
notifyDestroyed();
}
public void commandAction(Command c, Displayable d) {
if(c.getCommandType() == Command.EXIT)
notifyDestroyed();
}
public static void die()
{
self.notifyDestroyed();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -