Hi The lastest program I've been working on builds just fine, but outputs a nullpointer exception when run. I've been having some difficulty tracking this null pointer down. What I'd like to konw if theres a way to run your program step by step, which would be a big help in finding it. I'm just using the KToolbar at the moment. Would it help for me to download another development enviroment like JBuilder or something ?
It's not giving me a stack trace, thats a big part of the problem, the exception could be anywhere Just out of curiosity what IDE do you guys use ? How helpful are they ?
Actually for J2ME I only use TextPad and compile in the Toolkit. I have used IntelliJ Idea, but I haven't tried remote debugging. Wait I take that back, for some reason I think I might have.
But in almost all cases I just read the stack trace.
Try to catch the exception and use exception.printStackTrace() to print the stack trace to the console. Of course, this only works in the emulator. On the real device, your need a logging tool to log the stack trace to RMS or send it to a network server or display it on top of your app screen.
If you run the emulator from the command-line, it should print the stack trace directly to the console, IIRC. If not, Michael's suggestion should do the trick.