Hi,
I'm trying to get an animated GIF working in my swing program. I am drawing on a JPanel using paintComponent.
Here's the thing: It will animate, (faster then it should) and then pause animation for 5 seconds, then animate again. I am trying to achieve constant animation, at the framerate in which is set inside of the GIF file. Is there a better method to use then what I am using? It's not a repaint problem, as I am repainting constantly. Here's what I got:
String filename = "myimage.gif";
Image img = Toolkit.getDefaultToolkit().getImage(filename);
g.drawImage(img, x + 28, y + 79, this);
A code snippet would be helpful as I am only two weeks into Java and have difficultly reading the Sun documentation.
Thanks for reading,
Nate