File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes null point exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "null point exception" Watch "null point exception" New topic

null point exception

Anu sunny

Joined: Oct 21, 2013
Posts: 2
hello sir,
Iam new to j2me so recently i wrote a program on image in that i got a" null point exception" and image did not display. my img in the src folder is that correct? Please help me.

Error is:
Project "img" loaded
Project settings saved
Building "img"
Build complete
Running with storage root DefaultColorPhone
startApp threw an Exception
at javax.microedition.lcdui.Form.append(+11)
at ImageTutorial.startApp(+45)
at javax.microedition.midlet.MIDletProxy.startApp(+7)
at com.sun.midp.midlet.Scheduler.schedule(+270)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+116)
Execution completed.
735550 bytecodes executed
27 thread switches
741 classes in the system (including system classes)
3893 dynamic objects allocated (111700 bytes)
2 garbage collections (93492 bytes collected)

Code is:
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10825

Welcome to the Ranch.

Do you see anything wrong on line 4 of the above code snippet?

Also please check your Purple Mooseages for an important administrative matter

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Stuart A. Burkett
Ranch Hand

Joined: May 30, 2012
Posts: 679
Anu sss wrote:

Never do this. A catch block should not be empty. You should have at least a comment as to why you left it empty (there are occassionally good reasons for this). If you don't have a good reason, then you should at least print out the stack trace.
Anu sunny

Joined: Oct 21, 2013
Posts: 2
i wrote the code in catch block like "e.PrintTrace();" as you told before but, same exception error occured. so please help me
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Re-read Maneesh's post carefully, paying close attention to each line of code.
I agree. Here's the link:
subject: null point exception
It's not a secret anymore!