This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one for details.
in this code i have problems with buttonPause and buttonPlay:
where is the error???
posted 2 years ago
You haven't stated what the problem is.
A couple of problems with your code:
1. I don't know what the "scroll" variable is.
2. The easiest way to do animation is to create and ImageIcon and add the Icon to a JLabel and add the JLabel to your panel. Then when you want to move the label you just invoke setLocation(...) on the label. There is no need for a custom class to keep track ofe the location.