Possible duplication (solved): stack overflow
I have icons (jpg, png) for my application, which are stored in my directory /var/tmp/gameXbox/src/image/<here> . Now, how can I use them in an application, not using a hard link, but as a resource?
Example: not working
IconForMyButton = ImageIO.read(new File( ClassLoader.getSystemResourceAsStream("image/button1.png") ));

It works when I make a hard link:
IconForMyButton = ImageIO.read(new File( "/var/tmp/gameXbox/src/image/button1.png" ));
source share