欢迎来到天天文库
浏览记录
ID:8965172
大小:24.00 KB
页数:2页
时间:2018-04-13
《j2me手机游戏设计案例源代码-testtextfield》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、************TestTextFieldimportjavax.microedition.lcdui.*;importjavax.microedition.midlet.MIDlet;/***Thetextfielddemodisplaysallofthetextfieldtypesonthescreen*allowingtheusertoeditthematwill.**@version2.0*/publicclassTestTextFieldextendsMIDletimplementsComman
2、dListener{privateCommandexitCommand=newCommand("Exit",Command.EXIT,1);privatebooleanfirstTime;privateFormmainForm;publicTestTextField(){firstTime=true;mainForm=newForm("TextField演示");mainForm.append(newTextField("任意字符:","",15,TextField.ANY));mainForm.append(n
3、ewTextField("电子邮件:","",15,TextField.EMAILADDR));mainForm.append(newTextField("数字:","",15,TextField.NUMERIC));mainForm.append(newTextField("小数:","",15,TextField.DECIMAL));mainForm.append(newTextField("电话:","",15,TextField.PHONENUMBER));mainForm.append(newTextF
4、ield("密码:","",12,TextField.PASSWORD));mainForm.append(newTextField("网址:","",18,TextField.URL));}protectedvoidstartApp(){if(firstTime){mainForm.addCommand(exitCommand);mainForm.setCommandListener(this);firstTime=false;}Display.getDisplay(this).setCurrent(mainF
5、orm);}publicvoidcommandAction(Commandc,Displayables){if(c==exitCommand){destroyApp(false);notifyDestroyed();}}protectedvoiddestroyApp(booleanunconditional){}protectedvoidpauseApp(){}}
此文档下载收益归作者所有