1. How can I load icons from a JAR file?
2. Will the same piece of code work if the JAR is unzipped?
I've found a handful of posts that pose question #1 exactly, and in each case there was a solution that led to a happy ending. Not so in my case. Here are the solutions that I found:
a. use ClassLoader.getSystemResource(), then getToolKit().getImage()
b. use this.getClass().getResource(), then toolkit.createImage()
c. use this.getClass().getClassLoader(), then new ImageIcon()
The Developer's Guide (
Application Development Considerations) suggested "c". None of them work for me, the icon just refuses to be found.
I'd appreciate any help at all, otherwise it's back to head banging for me.
I've also seen references to "user.dir" to qualify the filename, but I don't understand why that would be required.