- 349 名前:345 mailto:sage [03/02/02 22:50]
- >>348
import javax.microedition.midlet.* ; import javax.microedition.lcdui.* ; public final class test extends MIDlet implements CommandListener { Form f1, f2 ; public test () { f1 = new Form("Form1") ; f2 = new Form("Form2") ; f1.addCommand( new Command( "Form2へ", Command.OK, 101)) ; f2.addCommand( new Command( "Form1へ", Command.OK, 102)) ; f1.append("これはForm1です。") ; f2.append("これはForm2です。") ; f1.setCommandListener( this) ; f2.setCommandListener( this) ; Display.getDisplay(this).setCurrent( f1); return ; } public void commandAction(Command c, Displayable d){ if( d==f1){ Display.getDisplay(this).setCurrent( f2); return ; } else if( d==f2){ Display.getDisplay(this).setCurrent( f1); return ; } else { System.out.println("えら〜") ; return ; } }
|

|