开发者

SWT- How to change ProgressBar color in Windows?

开发者 https://www.devze.com 2023-02-03 18:14 出处:网络
Is there a 开发者_运维百科way to change the color of a ProgressBar\'s bars in SWT?.setForeground() doesn\'t seem to work.

Is there a 开发者_运维百科way to change the color of a ProgressBar's bars in SWT? .setForeground() doesn't seem to work.

If there is not a way to change the color programmatically, is there a way to change ProgressBar's color using the WindowBuilder GUI tools?

Thanks!


In SWT there are 3 built-in states, each represented by a color:

progressBar.setState(SWT.ERROR); //Red Fill color. Useful when the task is aborted. 

This state does not support an indeterminate progress bar style (SWT.INDETERMINATE).

progressBar.setState(SWT.PAUSED); //Yellow Fill color.

This state will pause the indeterminate progress bar animation.

progressBar.setState(SWT.NORMAL); //Default state and color as controlled by OS.


You can't change the color of the progress bar on Windows using SWT.


You can now, using JProgressBar.setForeground( Color )

0

精彩评论

暂无评论...
验证码 换一张
取 消