Skip to main content

Where are my transparent windows?

Posted by javaerb on August 12, 2003 at 1:47 PM PDT

Have you noticed that I do a lot of complaining? Today I am wondering why Java has no direct support for alpha levels on windows or non-rectangular shapes. Every windowing system in the world seems to support this. Sun has done a good job moving toward support of multiple monitors, unusable screen real estate, and so forth. Why not this feature that would allow Java apps to be a little more competitive with native?

I may be wrong, but I have not found anything indication Java allows you to do this without native code. The closest I have found is a brilliant solution using Robot to grab a screen rectangle and then painting that as the background of a window. Why not at least invert this operation and allow drawing directly to the screen? (This is different from full-screen mode, which seems to be a large window covering the screen.) X Windows also allows drawing to the background (root window), though I am not sure MS Windows has an exact equivalent.

I should mention a product called JNIWrapper, which I have not worked with but appears to be a wonderful tool. It allows you to make system calls under Windows and Linux without writing native code, a sort of reflection-type scheme. Yeah, it's not 100% Pure Java and all that, but there are often some things you need to do that are platform-specific. After all, there's a reason JNI exists. All that JNIWrapper needs now is a Mac version. (All that the Mac needs now is good Java support...)

Related Topics >>