首页 > 代码库 > [J2ME] 获得MIDlet信息
[J2ME] 获得MIDlet信息
1 import javax.microedition.lcdui.Display; 2 import javax.microedition.lcdui.Form; 3 import javax.microedition.lcdui.TextField; 4 import javax.microedition.midlet.MIDlet; 5 import javax.microedition.midlet.MIDletStateChangeException; 6 7 8 public class main extends MIDlet { 9 10 private Display ds;11 private Form fr;12 private TextField tf;13 private String proString="";14 15 public main() {16 // TODO Auto-generated constructor stub17 proString=proString+"厂商: "+getAppProperty("MIDlet-Vendor")+"\n";18 proString=proString+"描述: "+getAppProperty("MIDlet-Description")+"\n";19 proString=proString+"自定义版本: "+getAppProperty("jadFile-Version")+"\n";20 proString=proString+"数据空间: "+getAppProperty("MIDlet-Data-Size");21 fr=new Form("MIDlet Properties");22 tf=new TextField("属性:",proString,500,TextField.ANY);23 fr.append(tf);24 }25 26 protected void destroyApp(boolean arg0) throws MIDletStateChangeException {27 // TODO Auto-generated method stub28 29 }30 31 protected void pauseApp() {32 // TODO Auto-generated method stub33 34 }35 36 protected void startApp() throws MIDletStateChangeException {37 // TODO Auto-generated method stub38 ds=Display.getDisplay(this);39 ds.setCurrent(fr);40 }41 42 }
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。