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.
是否可以从中间开始 JProgressBar。我知道这很奇怪,但我需要显示 20-80% 之间的更新,进度条应该在 0-20% 和 80-100% 之间不可见,数字 20 和 80 是运行时变量。
显示的值由基础数据模型 ( BoundedRangeModel) 决定。您可以子类化DefaultBoundedRangeModel(或通过实现从头开始创建BoundedRangeModel),以便getExtent()始终返回 20-80%。
BoundedRangeModel
DefaultBoundedRangeModel
getExtent()
可以JProgressBar通过其构造函数或setModel方法提供新模型。
JProgressBar
setModel