Search code examples
javaswttransparency

SWT: Transparent shell makes widgets transparent too


Using SWT, I set the shell transparency with setAlpha(x). But then all widgets have become transparent too. Even adding a "all white" image as a composite background became transparent. So I can't actually do anything on this window.

Does anyone have a clever idea how to bypass this?


Solution

  • I think this is a standard behavior for window shells on Windows OS. But you can achieve what you want by setting regions on the Shell...

    Have a look at this snippet: http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SWTShellcreateanonrectangularwindow.htm