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
# 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 ) {
}
}
# 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.