当前位置: 动力学知识库 > 问答 > 编程问答 >

progress bar - JavaFX ProgressBar Value doesn't work

问题描述:

ProgressBar pb = new ProgressBar(0.0);

pb.setProgress(1.0 - (1.0 / ((1.0 * 60) / 15000)));

I want progress bar show 60min state, but when left 15000min not really showing state.

网友答案:

1.0 - (1.0 / ((1.0 * 60) / 15000)) resolves to -249.0. A negative number indicates that you want to show indeterminate progress, which is why the progress bar will not show an actual value. Set the progress to a positive number between 0.0 and 1.0, or rather adapt your math accodingly.

分享给朋友:
您可能感兴趣的文章:
随机阅读: