HelloWorld MIDlet Error
Hi,all.
I'm using WTK2.2 to do a simple HelloWorld MIDlet, here's my problem:
I don't have problem with building but there is runtime error:
Running with storage root temp.DefaultColorPhone1157270008015
Unable to create MIDlet null
java.lang.NullPointerException
at com.sun.midp.midlet.MIDletState.createMIDlet(+14)
at com.sun.midp.midlet.Selector.run(+22)
Here is my code:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class HelloWorld extends MIDlet implements CommandListener {
private Command exitCommand;
private TextBox tbox;
public HelloWorld() {
exitCommand = new Command("Exit", Command.EXIT, 1);
tbox = new TextBox("Hello world MIDlet", "Hello World!", 25, 0);
tbox.addCommand(exitCommand);
tbox.setCommandListener(this);
}
protected void startApp() {
Display.getDisplay(this).setCurrent(tbox);
}
protected void pauseApp() {}
protected void destroyApp(boolean bool) {}
public void commandAction(Command cmd, Displayable disp) {
if (cmd == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
}
Thanks for helping.

