My first Program

Hi all,

I am a new comer to J2ME.

I wrote my first program in J2me, the hello world program.

While building no error reported, but on running the program

the following errors came.

Unable to create MIDlet null

java.lang.NullPointerException

can u help me.

Thanks in advance

47

[343 byte] By [codename47a] at [2007-11-27 6:40:25]
# 1
What are you using? WTK? Code? Which line was the error on? We're not psychics you know; though a couple may be psychos :D
nogoodatcodinga at 2007-7-12 18:09:40 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

am using WTK

here is the code

import javax.microedition.midlet.*;

import javax.microedition.lcdui.*;

public class MySample extends MIDlet {

public MySample() {

}

public void startApp() {

Form form = new Form( "First Program" );

form.append( "Hello World" );

Display.getDisplay(this).setCurrent( form );

}

public void pauseApp() {

}

public void destroyApp( boolean unconditional ) {

}

}

codename47a at 2007-7-12 18:09:40 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3

You should use the code tags, there's a button while posting, click that after selecting text to be formatted.

Your code seems to be fine, running on my system but I use NetBeans Mobility Pack with NetBeans. I've never actually used the WTK directly so I dunno.

Can you post the stack trace? Maybe that'll give some insight.

nogoodatcodinga at 2007-7-12 18:09:40 > top of Java-index,Java Mobility Forums,Java ME Technologies...