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

📄 stringitemfontdemo.java

📁 J2ME手机游戏开发技术详解,适合初学者阅读使用
💻 JAVA
字号:
import javax.microedition.lcdui.*;import javax.microedition.midlet.MIDlet;public class StringItemFontDemo    extends MIDlet    implements CommandListener {    private Display display;    private Form mainForm;    private Font font;    private final static Command CMD_EXIT =	    new Command("Exit", Command.EXIT, 1);        /**     * Signals the MIDlet to start and enter the Active state.     */    protected void startApp() {        display = Display.getDisplay(this);        mainForm = new Form("演示StringItem字体");        StringItem item = new StringItem("字体:", "均衡_下划线_小号字体");        font = Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_UNDERLINED,Font.SIZE_SMALL);        item.setFont(font);        mainForm.append(item);        item = new StringItem("字体:", "等宽_粗体_小号字体");        font = Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_BOLD,Font.SIZE_SMALL);        item.setFont(font);        mainForm.append(item);        item = new StringItem("字体:", "系统_斜体_小号字体");        font = Font.getFont(Font.FACE_SYSTEM,Font.STYLE_ITALIC,Font.SIZE_SMALL);        item.setFont(font);        mainForm.append(item);        item = new StringItem("字体:", "均衡_下划线_中号字体");        font = Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_UNDERLINED,Font.SIZE_MEDIUM );        item.setFont(font);        mainForm.append(item);        item = new StringItem("字体:", "等宽_粗体_中号字体");        font = Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_BOLD,Font.SIZE_MEDIUM );        item.setFont(font);        mainForm.append(item);        item = new StringItem("字体:", "系统_斜体_中号字体");        font = Font.getFont(Font.FACE_SYSTEM,Font.STYLE_ITALIC,Font.SIZE_MEDIUM );        item.setFont(font);        mainForm.append(item);        item = new StringItem("字体:", "均衡_下划线_大号字体");        font = Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_UNDERLINED,Font.SIZE_LARGE);        item.setFont(font);        mainForm.append(item);        item = new StringItem("字体:", "等宽_粗体_大号字体");        font = Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_BOLD,Font.SIZE_LARGE);        item.setFont(font);        mainForm.append(item);        item = new StringItem("字体:", "系统_斜体_大号字体");        font = Font.getFont(Font.FACE_SYSTEM,Font.STYLE_ITALIC,Font.SIZE_LARGE);        item.setFont(font);        mainForm.append(item);                mainForm.addCommand(CMD_EXIT);        mainForm.setCommandListener(this);        display.setCurrent(mainForm);    }    public void commandAction(Command c, Displayable d) {            destroyApp(false);            notifyDestroyed();            }        /**     * Signals the MIDlet to terminate and enter the Destroyed state.     */    protected void destroyApp(boolean unconditional) {    }    /**     * Signals the MIDlet to stop and enter the Paused state.     */    protected void pauseApp() {    }            }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -