Getting a picture out of a jar?
Hello, I am trying to load a picture that is in a jar into my program. The current method I am using works fine if the picture is in the same folder or package as the main program but if the program is in com.main and the picture is in com.images I can't get it to work. Does anyone know how to do this? Here is my current method of getting the image:
String imageName is usually "image.png" or whatever the name of the image is.
ImageIcon imIc = new ImageIcon(this.getClass().getResource(imageName));
this.pic = imIc.getImage();
Thanks for the help pbrockway2 :)