How to get a normally-repeating gif to only display once
I am working on a game using Swing for the GUI, and part of the dialog requires a 'surprised' sprite gif to run.
I have the normal talking gif in a JLabel, and can replace it with the 'surprised' gif, but I am unable to find a way to have it only display once. I have thought about getting each frame as rotating still jpg's or png's and then using the display time between the gif's frames, but I cannot find a way to get the display times, and it would be a terrible amount of work.
Also, if I could find a value of the total length of the gif, I might be able to let the rest of the thread Sleep for that length while it runs.
If any of these solutions is possible, it would be great for you to help. Thanks.