Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting rid of flicker in SWT

We are using a the following class to show a progress-bar in our Java application: TextProgressBar

Unfortunately we are having some problems with flickering when using that (Win 7, Java 7). Do you have any tips on how we can avoid that? Can we somehow repaint it less frequently, use double-buffering or something else? Any tips are greatly appreciated!

like image 324
Yrlec Avatar asked May 24 '13 09:05

Yrlec


2 Answers

try SWT.NO_BACKGROUND first, and if not use SWT.DOUBLE_BUFFERED. Do not use both at the same time, because there is no point. See the discussion

like image 20
Flummiboy Avatar answered Sep 17 '22 10:09

Flummiboy


First, try passing SWT.DOUBLE_BUFFERED in for the style parameter on construction. If that fails to improve the situation, move up the parent chain and add SWT.DOUBLE_BUFFERED to their constructor call instead.

If you don't have control over the parent, then you'll likely need to wrap your control in another Composite that has this flag enabled.

like image 103
Richard Wilkes Avatar answered Sep 17 '22 10:09

Richard Wilkes