Files not completely loaded

Hello,

here I am again … another problem :slight_smile:

I made a small applet to check FPS under Java2D. It has to be an applet since I think Java 1.2 doesn’t have JNLP yet (or am I wrong here?). But when you run the program the sprites are not loaded completely. I use the base code of the Java2D tutorial: http://www.cokeandcode.com/info/tut2d.html, and I also tried a mediatracker already. Any tips ?

You can find the applet here: http://users.pandora.be/kozen/Java2DTest/Applet/java2d.html

Seems to run quite happily here, whats the problem you’re seeing?

Is there a stack trace?

Kev

Could be the ImageIO bug. Try loading your images like this instead:

sourceImage = ImageIO.read(new BufferedInputStream(this.getClass().getClassLoader().getResourceAsStream(ref)));

doesn’t seam to help it. I don’t get any errors, but the aliens are not completely loaded when they are displayed. It’s quite strange. Doesn’t do anything at the FPS test, but it’s not so nice to see :slight_smile:

What java version are you running the appet on?

I seem to recall a bug like that in earlier versions (pre-1.4.2, I think) - the stream would just close and the image won’t be completely loaded.

I don’t have a solution to this but its actualy an unsolved problem on a game I did a while ago. The images weren’t completely loaded whenever I deployed from a jar, if I just had the applet load class files it worked fine though… I moved it to webstart recently and got the same problem. Its a bit more obvious on mine since the background hardly loads at all, also note the hands of the old men, they are cut off:

http://www.cyntaks.com/projects/spikeattack/webstart/spikeattack.php

is this the same problem you are having Guoshima?

Edit: I just tried the link and its not working, login for my webserver is broken (argh!!!), so I can’t find the correct path until its back up (I can’t use ftp, because of my firewall…).