Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Repaint in recursion

$
0
0
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();
}


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>