📄 hello3d.java
字号:
import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.*;
import javax.microedition.m3g.Graphics3D;
public class Hello3D extends MIDlet implements CommandListener
{
private Command exitCommand = new Command("Exit", Command.EXIT, 1);
public void startApp()
{
Form mForm = new Form("Hello 3D Properties:");
String s = new String();
Font.getFont(0, 1, 8);
mForm.append("\nM3G Version: ");
mForm.append(s + System.getProperty("microedition.m3g.version"));//获取M3G版本属性
mForm.addCommand(exitCommand); //添加退出按钮
mForm.setCommandListener(this); //设置软键监听
Display.getDisplay(this).setCurrent(mForm); //显示Form
}
public void pauseApp() { }
public void destroyApp(boolean unconditional) { }
public void commandAction(Command command, Displayable displayable)
{
if (command == exitCommand) //当按下Exit软键则退出程序
{
destroyApp(true);
notifyDestroyed();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -