Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

It won't let me add an image

843807Oct 20 2002 — edited Oct 22 2002
I'm trying to make a splash screen for applet and first I just want to display the image. I have this code in my init():
	Toolkit tk = Toolkit.getDefaultToolkit();
	Image splashImage = tk.getImage("R2Splash.gif");
	g.drawImage(splashImage, 30, 40, this);
It compiles, but when I try to run it, it takes me to the g.drawImage line and throws a NullPointerException.

Does this mean it's not finding the image or what?

Thanks,
Shawn
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 19 2002
Added on Oct 20 2002
5 comments
173 views