📄 menumidlet.java
字号:
/* * Created on 04-Apr-2004 at 16:14:27. * * Copyright (c) 2004-2005 Robert Virkus / Enough Software * * This file is part of J2ME Polish. * * J2ME Polish is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * J2ME Polish is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with J2ME Polish; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Commercial licenses are also available, please * refer to the accompanying LICENSE.txt or visit * http://www.j2mepolish.org for details. */package de.enough.polish.example;import javax.microedition.lcdui.*;import javax.microedition.midlet.MIDlet;import javax.microedition.midlet.MIDletStateChangeException;import de.enough.polish.util.Locale;import de.enough.polish.ui.List;import de.enough.polish.ui.Form;import de.enough.polish.ui.MenuBar;import de.enough.polish.ui.Container;import de.enough.polish.ui.StringItem;import de.enough.polish.ui.IconItem;//#ifdef polish.debugEnabled import de.enough.polish.util.Debug;//#endif /** * <p>Shows a demonstration of the possibilities of J2ME Polish.</p> * * <p>Copyright Enough Software 2004, 2005</p> * <pre> * history * 04-Apr-2004 - rob creation * </pre> * @author Robert Virkus, j2mepolish@enough.de */public class MenuMidlet extends MIDlet implements CommandListener { MyForm testform; MyContainer testcontainer; List menuScreen; Command startGameCmd = new Command( Locale.get( "cmd.StartGame" ), Command.ITEM, 8 ); Command quitCmd = new Command( Locale.get("cmd.Quit"), Command.EXIT, 10 ); //#ifdef polish.debugEnabled Command showLogCmd = new Command( Locale.get("cmd.ShowLog"), Command.ITEM, 9 ); //#endif Display display; public MenuMidlet() { super(); testform = new MyForm(); testcontainer = new MyContainer(); //#style mystyle StringItem st1 = new StringItem(null,"stringitem"); testcontainer.add(st1);// testcontainer.add(st2); //#style iconitem IconItem ii = new IconItem("ii", null); testcontainer.add(ii);// testcontainer.add(ii2); testform.append("3",null); testform.append(testcontainer); } protected void startApp() throws MIDletStateChangeException { //#debug System.out.println("setting display."); this.display = Display.getDisplay(this); this.display.setCurrent( testform ); //#debug System.out.println("sample application is up and running."); } protected void pauseApp() { // ignore } protected void destroyApp(boolean unconditional) throws MIDletStateChangeException { // just quit } public void commandAction(Command cmd, Displayable screen) { } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -