doggymidlet.java
来自「j2me开发的一些例子」· Java 代码 · 共 56 行
JAVA
56 行
/* * Copyright (c) 2000-2001 Sun Microsystems, Inc. All Rights Reserved. */package examples.animation;import javax.microedition.midlet.*;import javax.microedition.lcdui.*;/** * A MIDlet that displays the Doggy animation. * * @author Mark A. Patel - Motorola, Inc. * @author Roger Riggs - Sun Microsystems, Inc. **/public class DoggyMIDlet extends MIDlet implements CommandListener { Command cmdExit; /** * Constructs a new DoggyMIDlet **/ public DoggyMIDlet() { cmdExit = new Command("Exit", Command.EXIT, 1); } /** * Starts the app by creating a new Doggy instance and displaying it **/ protected void startApp() throws MIDletStateChangeException { Doggy d; d = new Doggy(); d.addCommand(cmdExit); d.setCommandListener(this); Display.getDisplay(this).setCurrent(d); } protected void pauseApp() { } protected void destroyApp(boolean unconditional) throws MIDletStateChangeException { } public void commandAction(Command c, Displayable d) { if (c == cmdExit) { try { destroyApp(false); } catch (Exception e) {} notifyDestroyed(); } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?