为什么我运行这个手机程序会有错误呢?
/** TestCreateProject.java*/
import javax.microedition.midlet.*;import javax.microedition.lcdui.*;
/** * The application must extend this class to allow the application * management software to control the MIDlet and to be able to retrieve * properties from the application descriptor */
public class TestCreateProject extends MIDlet implements CommandListener {
private Command exitCmd = new Command("Exit", Command.EXIT, 1); private Display display; private Form mainForm;
/** * Constructor for the MIDlet, * initializations of the form */
public TestCreateProject(){ }
/** * Signals the MIDlet to terminate and enter the Destroyed state. * In the destroyed state the MIDlet must release all resources and * save any persistent state * @param unconditional If true when this method is called, the * MIDlet must cleanup and release all resources. If false the * MIDlet may throw MIDletStateChangeException to indicate * it does not want to be destroyed at this time. * */
protected void destroyApp(boolean unconditional){
}
/** * Signals the MIDlet to enter the Paused state. * In the Paused state the MIDlet must release shared resources. */
protected void pauseApp(){
}
/** * Signals the MIDlet that it has entered the Active state * The method will only be called when the MIDlet is in the Paused state * Performs some initialization, places app in active state *@exception MIDletStateChangeException is thrown if the MIDlet cannot * start now but might be able to start at a later time. */
protected void startApp()throws MIDletStateChangeException{
display = Display.getDisplay(this); mainForm = new Form("TestCreateProject"); mainForm.addCommand(exitCmd); mainForm.setCommandListener(this); display.setCurrent(mainForm);
}
public void commandAction(Command c, Displayable d) { if (c == exitCmd) { destroyApp(false); notifyDestroyed(); }
}
}
//这是代码
一运行就会出现如下错误。
java.lang.NullPointerException: 0 - java.lang.Class.forName(), bci=0 - com.sun.midp.main.CldcMIDletLoader.newInstance(), bci=1 - com.sun.midp.midlet.MIDletStateHandler.createMIDlet(), bci=66 - com.sun.midp.midlet.MIDletStateHandler.createAndRegisterMIDlet(), bci=17 - com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=27 - com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=52 - com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=8 - com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=161 - com.sun.midp.main.MIDletSuiteLoader.main(), bci=22TRACE: <at java.lang.NullPointerException: 0>, Error occurred processing MIDlet event 21java.lang.NullPointerException: 0 - com.sun.midp.main.MIDletProxyList.findMIDletProxy(), bci=52 - com.sun.midp.main.MIDletProxyList.handleMIDletDestroyNotifyEvent(), bci=3 - com.sun.midp.main.MIDletControllerEventListener.process(), bci=335 - com.sun.midp.events.EventQueue.run(), bci=179 - java.lang.Thread.run(), bci=11TRACE: <at java.lang.NullPointerException: 0>, Error occurred processing MIDlet event 22java.lang.NullPointerException: 0 - com.sun.midp.main.MIDletProxyList.handleDisplayCreateNotifyEvent(), bci=56 - com.sun.midp.main.MIDletControllerEventListener.process(), bci=393 - com.sun.midp.events.EventQueue.run(), bci=179 - java.lang.Thread.run(), bci=11
同时出现的手机屏幕会是如我附件上传的图片一样,这是怎么回事呢?希望有人帮个忙。
同时手机界面出现这个错误。链接地址在这儿。希望有人解答下。http://wenwen.soso.com/z/q247213968.htm