PDA

View Full Version : Slow Animation in Java Applet


mark4man
09-06-2003, 09:20 PM
Put together a real nice animation of a moving rocket ship; & wanted it to be placed on a dynamic space background. Found a great free Java Applet (on this site . . . JavaScript Kit) entitled "Flying Stars", where a field of stars moves laterally across a black background (in the same direction as my animated ship)!

Trouble is, when I assign my animated .gif to the Applet code & preview in my browser, for some reason, the animation plays very, very slow (i.e., instead of the frames playing every .1 second, they play every 4 or 5 seconds.)

Was hoping someone here could provide some insight (& hopefully some answers.)

Thanks in advance,

mark4man

sstalpo
09-08-2003, 07:05 AM
I'm having the exact same issue..

I sure hope someone can help!

Sgt_Skullcrush
04-14-2009, 09:54 PM
Put together a real nice animation of a moving rocket ship; & wanted it to be placed on a dynamic space background. Found a great free Java Applet (on this site . . . JavaScript Kit) entitled "Flying Stars", where a field of stars moves laterally across a black background (in the same direction as my animated ship)!

Trouble is, when I assign my animated .gif to the Applet code & preview in my browser, for some reason, the animation plays very, very slow (i.e., instead of the frames playing every .1 second, they play every 4 or 5 seconds.)

Was hoping someone here could provide some insight (& hopefully some answers.)

Thanks in advance,


mark4manYou would need to make an animated sprit using ImagePlayer in Java and add the needed code to the Applet, recomplie it and get your new class file. All you can do with it right now is add a non animated pic. Java animation runs on thereds so it is repainting your gif over and over, so any animation has to be hard coded right in to any applet, application, or moblie app writen in Java. Check out Java.sun.com they have all kinds of tutorials and also look at down loading netbeans. I hope that helps or at lest points you in the right dir