📄 spacerdemo.java
字号:
import javax.microedition.lcdui.*;import javax.microedition.midlet.MIDlet;public class SpacerDemo extends MIDlet implements CommandListener{ private Display display; private Form mainForm; private StringItem item; private Spacer spacer; private final static Command CMD_GO = new Command("Go",Command.ITEM,1); private final static Command CMD_PRESS = new Command("Press", Command.ITEM, 1); private final static Command CMD_EXIT = new Command("Exit", Command.EXIT, 1); protected void startApp() { display = Display.getDisplay(this); mainForm = new Form("Spacer演示"); mainForm.append(new StringItem("", "BUTTON_1", Item.BUTTON)); mainForm.append(new Spacer(80,15)); mainForm.append(new StringItem("", "BUTTON_2", Item.BUTTON)); mainForm.append(new Spacer(80,15)); mainForm.append(new StringItem("", "BUTTON_3", Item.BUTTON)); mainForm.append(new Spacer(80,15)); mainForm.append(new StringItem("", "BUTTON_4", Item.BUTTON)); mainForm.addCommand(CMD_EXIT); mainForm.setCommandListener(this); display.setCurrent(mainForm); } public void commandAction(Command c, Displayable d) { destroyApp(false); notifyDestroyed(); } protected void destroyApp(boolean unconditional) { } protected void pauseApp() { } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -