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.

[1261 byte] By [peter1983a] at [2007-10-3 4:08:47]
# 1
I am not sure what your error is about,but looking at your codeyou are not supposed to calldestroyApp() methodyou only need to call notifyDestroyed() method onlyPravin
PMJaina at 2007-7-14 22:08:40 > top of Java-index,Java Essentials,New To Java...
# 2
Well, i checked the code with the destroyApp() method, that's nothing wrong since this code i copied from some of the websites. My problem is the runtime error and i checked with other MIDlet too. They all gave me the same error. Please help. Thanks.
peter1983a at 2007-7-14 22:08:40 > top of Java-index,Java Essentials,New To Java...
# 3
I have the exact same problem.I want to learn jaja, but ALL examples and tutorials I find give the same error...I will be something simple, but anyone knows what settings need to be chenged in NetBeans IDE 5.0 on a fresh install to get things working ?
Optioa at 2007-7-14 22:08:40 > top of Java-index,Java Essentials,New To Java...
# 4
What is the error message youre getting?
CaptainMorgan08a at 2007-7-14 22:08:40 > top of Java-index,Java Essentials,New To Java...
# 5

I had solved the HelloMIDlet error:

In the setting, class name must be same as the java filename(case sensitive) and remember do not include the extension .class

Before you load it to your phone, remember to check your phone's CLDP and MIDP version. If not, a "Invalid file" will be displayed at your phone.

peter1983a at 2007-7-14 22:08:40 > top of Java-index,Java Essentials,New To Java...
# 6
Why don't you go through the Hello World MIDlet application tutorial on the Sun JavaME/MIDP page which also provides an excellent introduction to the powerful NetBeans environment? http://www.netbeans.org/kb/50/quickstart-mobility.html
vapourmilea at 2007-7-14 22:08:40 > top of Java-index,Java Essentials,New To Java...