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

📄 customitemexample.java

📁 《J2ME Game Programming》随书光盘源代码
💻 JAVA
字号:

import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

public class CustomItemExample extends MIDlet implements CommandListener
{
   private Form form;

   public CustomItemExample()
   {
      form = new Form("A Custom Item");
      form.append(new SmileyItem("Smile"));
      form.addCommand(new Command("Exit", Command.EXIT, 0));
      form.setCommandListener(this);
   }

   public void startApp()
   {
      Display.getDisplay(this).setCurrent(form);
   }

   public void pauseApp()
   {
   }

   public void destroyApp(boolean unconditional)
   {
   }

   public void commandAction(Command c, Displayable s)
   {
      if (c.getCommandType() == Command.EXIT)
         notifyDestroyed();
   }

}

⌨️ 快捷键说明

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