I have a very simple animation task for Java. I need to create a basic “Wheel of Fortune Applet”. Basically what will be displayed is a wheel and a button. When that button is pressed I want it to select a random # of degrees (say in the range of 720-3600) and spin the wheel that many degrees. I will then use some logic to convert that degree number to a money value. My problem is in the animation, how do I get an image to spin at a constant pace for x number of degrees? Is there a swing function for that? Help would be much appreciated, I don’t need to know anything else about Java animation right now besides that.
Share
I’m going to assume that you understand how to rotate an image once. If you don’t, you can probably find that with a quick google search.
What you need is a background process that rotates it for you. It works like this: