问题
I am building an SWT application, I have used a ScrolledComposite
and a Composite
inside that. This has a few more buttons and checkboxes . All this is inside a Composite
.
Now I tried to put this main composite in the tab. It worked fine but the image flickers a lot even if I don't scroll or resize. If I put this main composite inside a shell, its working perfect without any flicker.
Why is this happening?
回答1:
Did you set the SWT.DOUBLE_BUFFERED
style bit on your Composite? That might fix it.
回答2:
Write SWT.DOUBLE_BUFFERED
in declaration
Example:
scrolledComposite = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.DOUBLE_BUFFERED);
来源:https://stackoverflow.com/questions/6958455/flickering-of-image-in-swt