where to put image jar files

now, jarred that icon image( it is of PNG type) named icons.jar without any subdirectory in it. i tried loading this image after putting this jar file in applets class files directory using this method

it is definitely highly appreciating, the way you have just given to use. but rather i have still a quary and i hope it will be erased

Rob Prime wrote: You can only use getClass().getResource() if the resource is in the exact same place as the class. Therefore, the image itself should be in the JAR file with the class itself.

you meant to say that, the applet class file must be jarred along with the image file. and the i can access directly this image from within jarred applet class, isn't it?

any way, i have tried without using jar file. just given the image file path as argument to ImageIO.read() method. but i got a strange thing, the image file was taking a long to load (even though is was not loaded)and i couldn't figure out what was occuring in background.

Originally posted by Nidhi Nagre: you meant to say that, the applet class file must be jarred along with the image file. and the i can access directly this image from within jarred applet class, isn't it?

If you don't JAR the applet class file, you don't need to JAR the image file. Just put it in the same folder.

If you JAR the applet class file, include the image file inside that same JAR file, in the same folder as the applet class file.

Nidhi Nagre
Ranch Hand

Joined: Nov 05, 2007
Posts: 64

posted Nov 29, 2007 00:44:00

0

Rob prime wrote:If you don't JAR the applet class file, you don't need to JAR the image file. Just put it in the same folder.

but, even after putting image file in same folder, the method getClass().getResources() was not able to access the image file, instead it flushed java.lang.classnotfoundexception, why??

in your 1st reply, you probabbly meant to say that if image file has not been jarred with applet class file then, instead, without using getClass().getResources method the image file can be acced simply by

This code should be placed inside the applet itself, otherwise you need either a reference to the applet to get access to the getDocumentBase() method, or a reference to the document base itself.

You can use getCodeBase() for the location of the class file if needed.

Nidhi Nagre
Ranch Hand

Joined: Nov 05, 2007
Posts: 64

posted Nov 29, 2007 01:26:00

0

i followed your way, but this time i got something strange,that instead if displaying image, something was running in background seemings for a long time. try to close the applet window was not making any effect too.

after closing it using window task manager,i got the following at java console

i cant figure, what is this mean?

by the way i am using the code

[ November 29, 2007: Message edited by: Nidhi Nagre ]

Nidhi Nagre
Ranch Hand

Joined: Nov 05, 2007
Posts: 64

posted Nov 30, 2007 10:53:00

0

please help me, its urgent

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com