Hi I am trying to write a simple J2ME application, (I've only started learning it), and am getting the following error:
Unable to create MIDlet null
java.lang.NullPointerException
at com.sun.midp.midlet.MIDletState.createMIDlet(+29)
at com.sun.midp.midlet.Selector.run(+22)
I don't know what's wrong. Any suggestions would be greatfully received. My code is as follows:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class HelloWorld extends MIDlet implements CommandListener
{
private Display display;
private TextBox textBox;
private Command quitCommand;
public void startApp()
{
display = Display.getDisplay(this);
quitCommand = new Command("Quit", Command.SCREEN, 1);
textBox = new TextBox("HelloWorld", "My first MIDlet", 40, 0);
textBox.addCommand(quitCommand);
textBox.setCommandListener(this);
display.setCurrent(textBox);
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
public void commandAction(Command choice, Displayable displayable)
{
if(choice == quitCommand)
{
destroyApp(false);
//notifyDestroy();
}
}
}
Thanks, sweetchuck