Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GIF's and IMAGEICON's...

 
Pat Ziel
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone. I have this issue:

I set an imageIcon on a JButton component. This imageIcon is an animated .gif I made.

When I run my program, the first time I click the animation is properly executed. Afterwards, when I click on other buttons that are present on my grid they skip to the last frame.

Here's the method that is being called:



Now, I assume the image is loaded once in memory and being animated once it doesn't do it again?

P.S I've made my image so that it repeats once. If I loop it, it works fine. But I don't want it to loop.
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing.
 
Andreas Pax Lück
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!

i've got exactly the same complication. but i don't really understand what's meant with swing in this case. does the swing library contain a special resource loader or something else?

my animated gif isn't set on unlimited animation repetition. but i have to show the gif animation more than one time anyhow.

how can i reload the image file again?

best regards

PAX
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic