M
Marcin Siewiera
I wrote an applet(board game) which is loaded from .jar file. The
applet is loading somehow too slow, its just 120 kB. I reckon the
reason is the applet is getting what it needs from .jar, and as i load
images one by one it takes a while... Is there any way to download
whole .jar when applet starts?
I access images with
URL path=null;
try{
path=getClass().getResource("/game/images/"+filename);
image=Toolkit.getDefaultToolkit().getImage(path);
MediaTracker imgTrack=new MediaTracker(parent);
imgTrack.addImage(image,0);
// waits until board image is loaded
try {
imgTrack.waitForAll();
}
catch (InterruptedException e) {
}
applet's URL www.bescres.net/play_html.htm (U need JRE 1.42 to run
applet correctly)
I appreciate any suggestions
applet is loading somehow too slow, its just 120 kB. I reckon the
reason is the applet is getting what it needs from .jar, and as i load
images one by one it takes a while... Is there any way to download
whole .jar when applet starts?
I access images with
URL path=null;
try{
path=getClass().getResource("/game/images/"+filename);
image=Toolkit.getDefaultToolkit().getImage(path);
MediaTracker imgTrack=new MediaTracker(parent);
imgTrack.addImage(image,0);
// waits until board image is loaded
try {
imgTrack.waitForAll();
}
catch (InterruptedException e) {
}
applet's URL www.bescres.net/play_html.htm (U need JRE 1.42 to run
applet correctly)
I appreciate any suggestions