posted 17 years ago
Hi,
Apparently its possible to load images that are contained within a JAR, but I could never get it to work, so I came up with my own solution:
Basically load the pic in the normal way, then scan it to get the pixel data. You then save this, so you can generate BufferedImages at runtime from the pixel data.
Drawback is, this is probably only a good idea for small pics, such as chess pieces (50 by 50 pngs in my case).
Another possibility is to save a text file in the jar with the same pixel data, and then do the same thing.
But I'm sure the people here can show you the proper way to do it with images in jars.