使用 Nimbus 更改 JProgressBar 的颜色?
有谁知道当您使用 Nimbus LookAndFeel 时如何更改 JProgressBar 的颜色?
does anyone know how to change the colors for JProgressBar when you use Nimbus LookAndFeel?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我已经覆盖了整个
nimbusOrange
-默认值,它更改了所有 ProgressBar-Colors 和任何其他nimbusOrange
。 (InternalFrame - 最小化按钮)这里使用
nimbusBase
(蓝色)更好的是编写一个自己的 Painter 并将其设置为
UIManager
通过如果您只想更改单个 ProgressBar 实例的颜色,您可以使用每个组件自定义
I have overridden the whole
nimbusOrange
-Default Value, which change all ProgressBar-Colors and any othernimbusOrange
. (InternalFrame - minimize Button)here with
nimbusBase
(blue)Better is to write a own Painter and set this to the
UIManager
viaIf You want to change the Color for only a single ProgressBar instance, you can use Per-component customization
MyPainter 的一个例子如下:
但是我的编译器或 IDE (eclipse) 说它不知道 Painter。
有没有人可以帮助我!
an example of MyPainter can be as following:
but my compiler or IDE (eclipse) says that it doesn't know the Painter.
is there anybody to help me!