JavaFX Thread freeze

前端 未结 2 762
南旧
南旧 2021-01-28 23:56

I\'m currently working on a JavaFX project. On GUI initialization I want to read some infos out of a HTML document using Selenium and FirefoxDriver. Normally I would use a crawl

2条回答
  •  鱼传尺愫
    2021-01-29 00:43

    You are trying to update the UI from a different thread. The UI can only be updated from the UI thread. To achieve this, wrap the calls to update the progress:

    Platform.runLater(() -> {main.getPbStart().setProgress(0.65);});
    

    This will push the update of the UI into the UI thread.

提交回复
热议问题