Okay, so I've done a fair amount of searching and testing on my own so I figure it's time to ask the experts.
I'm currently building a Java applet. It's purpose is to find a hamiltonian cycle... that part I got working fine... but my problem is this, I want my graph to change colors from black to red as it goes from point to point. I can get them to change colors but i can't seem to get it to update consistently. I've tried adding pauses before calling repaint() after calling repaint() and even in the repaint function but I get relatively the same result.
The closest I got was putting a pause after each line is drawn on the applet, but this only managed to get me the final result painted slowly.
here's where changes are made and repaint() is called...
ugh... I don't even know what else to post or say since I've tried every configuration I can think of and the full code is rather lengthy.
Any help is appreciated
I'm currently building a Java applet. It's purpose is to find a hamiltonian cycle... that part I got working fine... but my problem is this, I want my graph to change colors from black to red as it goes from point to point. I can get them to change colors but i can't seem to get it to update consistently. I've tried adding pauses before calling repaint() after calling repaint() and even in the repaint function but I get relatively the same result.
The closest I got was putting a pause after each line is drawn on the applet, but this only managed to get me the final result painted slowly.
here's where changes are made and repaint() is called...
Code:
if(eArray[i][vArray[i].edges[j]].visable){
eArray[i][vArray[i].edges[j]].col = Color.red;
}
else{
eArray[vArray[i].edges[j]][i].col = Color.red;
}
vArray[i].visited = 1;
steps--;
repaint();
Any help is appreciated
Comment