📄 hellomidlet.java
字号:
//HelloMIDlet.java
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import org.spruce.midp.SpruceFloat;
public class HelloMIDlet extends MIDlet implements CommandListener
{
private Command exitCommand;
private Display display;
SpruceFloat a = new SpruceFloat("3.14");
public HelloMIDlet()
{
display = Display.getDisplay(this);
exitCommand = new Command("Exit", Command.SCREEN, 2);
}
public void startApp()
{
TextBox t = new TextBox("Hello MIDlet", "Mobile世界你好", 256, 0);
t.addCommand(exitCommand);
t.setCommandListener(this);
display.setCurrent(t);
}
public void pauseApp()
{ }
public void destroyApp(boolean unconditional)
{ }
public void commandAction(Command c, Displayable s)
{
if (c == exitCommand)
{
destroyApp(false);
notifyDestroyed();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -