⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spacerdemo.java

📁 J2ME手机游戏开发技术详解,适合初学者阅读使用
💻 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 + -