Java Swing Loading Animation

Vincent Roye picture Vincent Roye · Jan 9, 2012 · Viewed 29.1k times · Source

I Would like to realize the following loading animation with java swing :

enter image description here

The circle has to spin clockwise.

What would be the best way to make it ?

Thank you very much.

Answer

Jakob Weisblat picture Jakob Weisblat · Jan 9, 2012

Just use an ImageIcon and an animated gif. see setImageObserver in ImageIcon.

Loading icons can be made using a variety of online generators such as AjaxLoad.