SWT- How to change ProgressBar color in Windows?

前端 未结 3 1787
青春惊慌失措
青春惊慌失措 2021-01-21 10:21

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 progr

3条回答
  •  广开言路
    2021-01-21 10:32

    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.
    

提交回复
热议问题