I've written a game that uses PNGs, and when I exported it, the images wouldn't work. I added getClass().getClassLoader().getResource()
to everywhere I import an image, but the JAR won't even launch anymore. It used to open, but none of the images worked. Now it won't even open the JAR.
This is how I get the image for the muffin:
muffin=new ImageIcon(getClass().getClassLoader().getResource("muffin.png")).getImage();
Actual path for it is: C:\Users\My User Name\Dropbox\FinalProjectWithoutApplet\muffin.png
What should I do to solve this issue?
Thanks!