Have you tried using the getResource function?
If you do something like this:
public class Class1 {
...
URL imageURL = this.getClass().getResource("image.gif");
ImageIcon icon = new ImageIcon(imageURL);
...
}
the file called image.gif is assumed to be located in the root
directory of the jar that contains Class1.class.