Modify the class RotatorPanel in a way that when the button "Run" is pressed, the corresponding arc starts to rotate, and when the button "Pause" is pressed, the corresponding arc stops rotating.
Hint: The modified RotatorPanel class should implement the Java interface Runnable. The solution should use the Thread methods wait and notifyAll which implies that you have to consider an appropriate synchronization. The rotation of the corresponding arcs is achieved by calling method "rotate()" of class ArcPanel in the method "run()" to be implemented.
Still stuck? Ask yourself: How many threads are there? What is shared? What is synchronized? Who reads? Who writes? Who waits? Who notifies?
DoubleRotator.java, RotatorPanel.java, ArcPanel.java
The result may look like this.