《J2ME手机游戏设计案例源代码-TextBoxTest》由会员分享,可在线阅读,更多相关《J2ME手机游戏设计案例源代码-TextBoxTest(2页珍藏版)》请在金锄头文库上搜索。
1、*TestMID/* To change this template, choose Tools | Templates* and open the template in the editor.*/import javax.microedition.lcdui.Command;import javax.microedition.lcdui.CommandListener;import javax.microedition.lcdui.Display;import javax.microedition.lcdui.Displayable;import javax.microedition.lc
2、dui.TextBox;import javax.microedition.lcdui.TextField;import javax.microedition.midlet.*;/* author Administrator*/public class TestMID extends MIDlet implements CommandListener Display ds;TextBox textbox;public TestMID()ds=Display.getDisplay(this);textbox=new TextBox(游戏,30,TextField.ANY);Command c1=
3、new Command(退出,Command.EXIT,2);Command c2=new Command(选择,Command.SCREEN,2);Command c3=new Command(开始,Command.SCREEN,2);Command c4=new Command(暂停,Command.SCREEN,2);textbox.addCommand(c1);textbox.addCommand(c2);textbox.addCommand(c3); textbox.addCommand(c4);textbox.setCommandListener(this);ds.setCurrent(textbox);public void startApp() public void pauseApp() public void destroyApp(boolean unconditional) public void commandAction(Command c, Displayable d) throw new UnsupportedOperationException(Not supported yet.);