Images(.gif/.jpg) from JAR.

Hi,Is there any way to load images from JAR file?I am not able to get images to Java application (GUI) from JAR file. If I extract JAR file it is working. Any help is appreciated. Rama Reddy.
[234 byte] By [ramareddys] at [2007-9-26 3:15:52]
# 1

You want to start with:

getClass().getResourceAsStream("MyPicture.gif");

That will read your given filename (from your JAR) as an InputStream. You can read it into an Image or whatever from there. I've only done it with a text-file, so I don't know the particulars about loading an image.

Michael Bishop

mbishop78 at 2007-6-29 11:27:30 > top of Java-index,Desktop,Runtime Environment...