Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 Java 新手,我正在构建一个基本上可以作为实时时间表工作的程序。它的作用是显示事件,后跟进度条、事件时间(例如 8:00 - 9:00)和事件剩余时间。我将如何对进度条进行编程,例如从 8:00 开始并在 9:00 进行进度并完成?提前致谢!
Java教程:
http://download.oracle.com/javase/tutorial/uiswing/components/progress.html
一般的想法是计算已经过去的时间间隔的百分比,并使用计算setProgress()的JProgressBar百分比调用。
setProgress()
JProgressBar
您肯定希望使用Timera 定期检查。
Timer