Skip to Main Content

Image Loading

colin-javaFeb 16 2012 — edited Feb 19 2012
Hi...

I'm able to load (as java.awt.Image's) images inside the project (located with the source code) from both netbeans and after exporting to jar/jnlp.

But supposing I have a folder (res) of images in the folder that the projects jar file is in. I'm unable to load these images into the program.
I thought this would work...
return Toolkit.getDefaultToolkit().getImage("res/myImage.jpg");

But it doesn't, any ideas how to fix this?
Comments
Post Details
Added on Feb 16 2012
11 comments
4,742 views