覆盖几个 JProgressBar?
我想要一个 JProgressBar实际上是几个分层在一起的JProgressBar
。这样的实现存在吗?在我破解Flithy Rich Clients并尝试将其组合在一起之前,我想知道这一点。
这是我的问题:我有一堆对象在几个状态之间线性转换(在我的例子中是 4 个,但这是任意的)。我想在一个(复合)进度条上显示每个对象相对而言有多少已达到每种状态。状态转换从开始到结束都是纯线性的,因此状态 N + 1
的对象永远不会多于处于状态 N
的对象。
我正在想象一个有四种颜色的进度条,所有四个条从左到右增加,最终以覆盖整个进度条的第四个状态的颜色结束。
I'd like to have a JProgressBar that is actually several JProgressBar
s layered together. Does such an implementation exist? I'd like to know before I crack out Flithy Rich Clients and try to put one together.
Here is my problem: I have a bunch of objects that transition linearly through several states (4 in my case, but that is arbitrary). And I'd like to show, on one (composite) progress bar how many of each of the objects, relatively, has made it to each state. The state transitions are purely linear from start to end, so there are never more objects state N + 1
than have been in state N
.
I'm picturing a progress bar with four colors and all four bars increase from left to right, eventually ending with the color for the 4th state covering the entire progress bar.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有一个特定的组件完全符合您所描述的功能。但是,您可以为每个状态创建一个进度条实例,再加上一个显示总进度的复合条。这将是您使用标准组件所能得到的最接近的结果。
There is not a specific component that does exactly what you describe. However you could create on instance of a progress bar for each state, plus one composite bar that shows total progress. This would be as close as you could get with the standard components.