测试手机对J2ME支持情况

作者:袖梨 2023-08-16

import javax.microedition.lcdui.Display; 

import javax.microedition.lcdui.Form; 

import javax.microedition.lcdui.StringItem; 

import javax.microedition.midlet.MIDlet; 

import javax.microedition.midlet.MIDletStateChangeException; public class SysInfo extends MIDlet { 

private static Display display; 

private Form f; 

private StringItem si; 

private void appendItem(String lable,String name){ 

String it=System.getProperty(name); 

if (it!=null&&it.length()>0){ 

si = new StringItem(lable, it); 

f.append(si); 

/** 

*/ 

public SysInfo() { 

super(); 

display = Display.getDisplay(this); 

f = new Form("系统信息"); 

// TODO 自动生成构造函数存根 

/* 

* @see javax.microedition.midlet.MIDlet#startApp() 

*/ 

protected void startApp() throws MIDletStateChangeException { 

// TODO 自动生成方法存根 

appendItem("平台名称:","microedition.platform"); 

appendItem("CLDC或CDC版本:","microedition.configuration"); 

appendItem("MIDP版本:","microedition.profiles");

相关文章

精彩推荐