JProgressBar problem
Dear experts,
I just completed developing a sudoko game.In the game there is a
process having multiple for /while loops.While this process is going on ,
at times user becomes idle.I want that a progressbar should continously show increment of processing.
I added a progressbar and used setValue() of current status value.
However in for/while loops there is no progress visible.
However when loop is over i get 100% and progress bar at top.
Using a secondary approach i tried Thread class and invoked run().
This too has gone in vain.Then i used setPriority method but not working.How to proceed ?
[652 byte] By [
Adi1000a] at [2007-11-27 7:12:57]

After almost 400 postings in the forum you should know that Swing related questions should be posted in the Swing forum.
But there is no need to repost the question since the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html]How to Use Progress Bars[/url] has working examples.
Dear friends i have tried numerous ways like
try {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
it.updateBar(percent);
}
});
java.lang.Thread.sleep(100);
} catch (InterruptedException e) {
;
}
Then further i applied a different way by implementing ChangeListener
interface and defining in statechanged() abstract method the above snippet
try {
new Runnable() {
public void run() {
pb.setValue(gb);
}
};
java.lang.Thread.sleep(100);
} catch (InterruptedException ex) {
;
}
All techiniques have failed.Any further ?