G
G
Gfd2015-12-13 21:53:58
Java
Gfd, 2015-12-13 21:53:58

How to properly update Progressbar from a loop?

1) Why does it wait until it is 100% full and only then updates from 0% to 100%
2) And the second is off topic. How to change the "Done" label after it is filled to 100%
static double TimeStart=0;
public ProgressIndicator time;
public void start(){
if(ChoiceRe.getText()=="Normal"){
time.progressProperty().bind(progress);
for(int row=0;row<100;row++){
try {
TimeStart=TimeStart+0.01;
progress setValue(TimeStart);
Thread.sleep(27);
} catch (InterruptedException e) {}
}
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question