I am trying to call repaint inside a recursion method but it is only actually painting once at the end. Is there a way to paint multiple times inside a recursion method?
public void solveHanoi(int disks, int fromPole, int toPole, int withPole) {
if (disks >= 1) {
solveHanoi(disks-1, fromPole, withPole, toPole);
moveDisk(fromPole, toPole);
solveHanoi(disks-1, withPole, toPole, fromPole);
}
}
public void moveDisk(int fromPole, int toPole)
{
//code
repaint();
}