ProgressBar doesn't work with a fxml file and a controller

前端 未结 1 1524
眼角桃花
眼角桃花 2021-01-23 02:04

So I used this link to set up my progress bar and it worked perfectly fine when I ran this code.

However, with the setup that I have, I can\'t seem to get the progressba

相关标签:
1条回答
  • 2021-01-23 02:51

    in your controller you do :

        progressBar = new ProgressBar(0);
    

    this mean it will create a new instance of ProgressBar and it will not use your progressBar from your FXML anymore. Just remove this line, it should works

    0 讨论(0)
提交回复
热议问题