jar (...yes a jar), ImageIcon, files in a package = hell :(
843804Oct 27 2004 — edited Aug 26 2009Hi, I hate to post a question involving jar's here, but nobody in the jar forum knows how to solve this problem...
I have a package (called life), and I have made a jar which holds this package. In this package I have a bunch of .png images, and a .class file. I need to make an ImageIcon out of these images....but when I view the jar....I get a
Java.lang.nullPointer exception (it simply cannot find the images)
I have been told.....
to change the classpath......didn't seem to work, although im using eclipse, is this a problem? I manually changed the manifest file...still didn't work.
to use
url = cl.findResource("image.png");
drawImage(Toolkit.getDefaultToolkit().getImage(url), 320, 320, this);
this failed miserably
to use
URL url = this.getClass().class.getResource("/Image.png");
this, and any variation of of getResource() has falso failed miserably
And I am ready to kill myself
Please help me :(