新手提问
这是例子代码
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
public class first extends MIDlet{
private Display display;
public first(){
display=Display.getDisplay(this);
}
protected void destroyApp(boolean arg0) {
// TODO Auto-generated method stub
}
protected void pauseApp() {
// TODO Auto-generated method stub
System.out.println("pauseApp is called.");
}
protected void startApp() {
// TODO Auto-generated method stub
System.out.println("startApp is called.");
Form f = new Form("HelloTest");
display.setCurrent(f);
}
}
为什么有时运行成功,不时不成功,
不成功时控制台输出以下信息,
Exception in thread "main"
java.lang.UnsatisfiedLinkError: com.sun.midp.main.Configuration.getProperty0(Ljava/lang/String;)Ljava/lang/String;
at com.sun.midp.main.Configuration.getProperty0(Native Method)
at com.sun.midp.main.Configuration.getProperty(Configuration.java:32)
at com.sun.midp.lcdui.Resource.<clinit>(Resource.java:30)
at com.sun.midp.main.Main.initSystemLabels(Main.java:686)
at com.sun.midp.main.Main.main(Main.java:103)
------解决方案--------------------
你要展开项目,然后右击first类,运行方式,Emulated J2ME Midlet