Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2003
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question Slow Animation in Java Applet

    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

  • #2
    New Coder
    Join Date
    Sep 2003
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Same issue

    I'm having the exact same issue..

    I sure hope someone can help!

  • #3
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    You can not use animated .gif's with Java

    Quote Originally Posted by mark4man View Post
    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
    You 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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •