I've got a non-looping gif that I use as ImageIcon for two JLabels, but not at the same time.
My problem is that when I set the second JLabel's icon to be the gif, the animation has already been played, so it only show the last frame of it.
Do you know a way to get the animation when the gif is set to the second JLabel?
On the newly created icon try using:
Ok,
discarded old answer. After some more searching around I found the way to do it.
Java Api: Image#flush()
btw. if you leave the line
label1.setIcon(null);
out it will still repeat the animation of the icon only for label2. label1 stays at the last frame.