Hey,

I'm getting this error every time I run my program. I dunno what it means and how to fix it.

Uncaught error fetching image:
java.lang.NullPointerException
	at sun.awt.image.URLImageSource.getConnection(URLImageSource.java:99)
	at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:113)
	at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:240)
	at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
	at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)

According to this your image does not exist. Make sure you have the correct directory, and the image name is correctly typed (including the extension).

Is that the full text of the error message?
The stack trace doesn't show what line in your program the error occurred on.

What lines of source in your program causes this error?

@ Norm.. I think it's showing at what line the error is occuring. 99 and 113 and 240 are assumed to be the line numbers. I want to trace the lines but I couldn't find them in the program I was tryin to run.

If you want help, you'll have to post the full text of the message.
What you posted doesn't look like it includes the lines from your program.

How are you executing the program? IDE, command line or ???

Without the full text giving the source line number in your code it's very hard to find the problem

Without the full text giving the source line number in your code it's very hard to find the problem

This article has been dead for over six months. Start a new discussion instead.