How to avoid image loading every time an applet is being loaded?

Hi, i'm developing an appled that make extensive usage of graphics and Images.

It seems that clients download the images (almost 5 mb in total) every time the applet is loaded.

i would like a behaviour very similar to flash.. "if u have it, u dont need to download it again".. it is possible?

Going deeper into the problem:

this.getImage(this.getCodeBase(), sName);

to load the requested image during the applet execution, so loading may

happen also outside the constructor

the ideal solution whould be something like that

Image hRequested = this.findFromCookies(sName);

if(hRequested ==null)

//load with the standard method..

[794 byte] By [Alx_ITa] at [2007-11-27 8:27:29]
# 1

Put the images and your class files into a jar file.

Use Class.getResource or getResourceAsStream to get the images.

When the client gets the applet, it downloads the whole jar and runs it from there. Once it does that, the images all come from the jar file, which has already been downloaded.

It'll take longer to download the big jar than it takes to download an individual class, but the total download time will be shorter.

paulcwa at 2007-7-12 20:17:08 > top of Java-index,Desktop,Core GUI APIs...