File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "null point exception" Watch "null point exception" New topic
Author

null point exception

Anu sunny
Greenhorn

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
java.lang.NullPointerException
java.lang.NullPointerException
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: 9995
    
    7

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
Greenhorn

Joined: Oct 21, 2013
Posts: 2
sir,
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
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
Re-read Maneesh's post carefully, paying close attention to each line of code.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: null point exception
 
Similar Threads
ERROR: Jar files and manifest probs
unable to create form.
commandAction - newbie
Images sometimes don't display
problem in connecting floggy using j2me