ProgressBar in Javafx does not update in onAction block

前端 未结 2 1824
天命终不由人
天命终不由人 2020-11-29 11:04

I\'d like to have a progress bar that updates inside an onAction block. For some reason in the following code, the progress bar doesn\'t update until it exits

2条回答
  •  失恋的感觉
    2020-11-29 11:32

    You are blocking the javafx event thread you need to do the work in another thread and sync back only the setProgress call with Platform.runLater

提交回复
热议问题