Reputation: 2259
I'm loading an animated gif into a JButton. Online the gif looks to move at a normal pace. But when I load it in java it looks like the animation is trying to run as quickly as possible! How can I atleast slow it down?
Here is my code:
public Icon getIcon(){
return new ImageIcon(getClass().getResource("images/working.gif"), "Application is running.");
}
Any ideas? Thanks guys 'n gals.
Upvotes: 0
Views: 2305
Reputation: 13907
Browsers tend to limit the framerate of GIFs. For example, I've read that Opera and IE will fix framerates slower than Firefox. Here's an example of people seeing this effect.
The problem is likely that the delay in the animation is incorrect in the .gif itself, and viewing it in a browser is only masking the issue.
Upvotes: 2