/* Form のテスト Ver 0.00 */ /* */ /* */ /* by Atsushi 2000/7/24 */ import javax.microedition.lcdui.*; import javax.microedition.midlet.*; public class FormTest extends MIDlet implements CommandListener { /* --- Field --- */ private Display display; private Command exit; /* --- Constructor --- */ public FormTest() { display=Display.getDisplay(this); exit=new Command("Exit",Command.SCREEN,2); } /* --- 開始・終了 --- */ public void startApp() { Form form; form=new Form("Forms"); form.appendItem(new StringItem("StringItem1","Item:TextField-1")); form.appendItem(new TextField("TextField1","TextField1",16,0)); form.appendItem(new StringItem("StringItem2","Item:ImageItem")); form.appendItem(new ImageItem("ImageItem1", Image.createImage("/java.gif"),ImageItem.LAYOUT_DEFAULT,"Image")); form.appendItem(new StringItem("StringItem3","Item:TextField-2")); form.appendItem(new TextField("TextField2","TextField2",16,0)); form.addCommand(exit); form.setListener(this); display.setCurrent(form); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } /* --- イベント --- */ public void commandAction(Command c,Displayable s) { if (c==exit) { destroyApp(false); notifyDestroyed(); } } }