0

Hey guys

I am calling two images using the code below, the first image called shows up when run, and when compiled into a executable jar. The other image shows up when run in eclipse but not when compiled into an executable jar:

Here is the code:

image = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("myPicture.png"));

Why is this happening?

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by JamesCherrill
0

I presume both pix are in the jar? Check the file name case - they are case-sensitive in jars but not in the windows file system.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.