The Source for Java Technology Collaboration
User: Password:



Kirill Grouchnikov

Kirill Grouchnikov's Blog

Translucent and shaped windows in core Java

Posted by kirillcool on February 27, 2008 at 09:38 AM | Comments (7)

The lack of support for translucent and shaped windows has been a subject of quite a few complaints about AWT and Swing. This has finally been addressed in the latest 6u10 build.

Here is how a translucent window looks like:

window-translucent.png

And here is a shaped window:

window-shaped.png

And here is a translucent and shaped window:

window-translucent-shaped.png

For more (unofficial) information on where these APIs are located and how to use them, click through to Pushing Pixels.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • That's really great news for Swing, and Java client in general. But then you have hacks like Dion Almaer over there spreading all that FUD about Swing and telling us that it's drowning. I think he should just stick to his Ajax agenda, maybe that will serve him better. But then again maybe that's what's his Ajax agenda is all about.

    Posted by: mikeazzi on February 27, 2008 at 12:00 PM

  • Are the shaped windows going to be anti-aliased with whatever is behind them? I've played with the jna libraries that allow you to do this with current Java, but the shaped window edges look pretty terrible if you're using any type of curves.

    Posted by: sjoyner on February 27, 2008 at 02:20 PM

  • At last. Whohoo! :)

    I do not want to rain on that parade but sjoyner is correct, if rounded shapes are to be used at all they need to be anti-aliased. But I don't know, maybe that is not possible?

    It would also be good if there were some what to make the translucency of the painted stuff in the window actually decide the translucency of the window. That would of course also solve the anti-aliased edges...

    Good stuff anyway.

    Posted by: mikaelgrev on February 27, 2008 at 03:02 PM

  • The translucent window looks great! Wouldn't it be more accurate to describe the shaped window as clipped? It appears to be a normal window clipped to an ellipse. I would expect a shaped window to adjust it's decorations to the border. Perhaps I misunderstood "shaped window"? Great work as usual Kirill, I really enjoy your blog.

    Posted by: dcartwright on February 28, 2008 at 07:23 AM

  • Finally. It's good news. Would be nice if the Swing team can add 'type ahead' feature to JFileChooser in the next update. The 'type ahead' feature for JFileChooser is a feature that Swing should have.

    Posted by: jdevp2 on February 28, 2008 at 03:52 PM

  • Great work Kirill, your unwavering committment to posting so many of these snippets of useful and relevant information is most appreciated.

    Posted by: caultonpos on February 29, 2008 at 04:21 PM

  • It's really great to know about this. In GUI, Java was always far behind from Flash.Now its catching up.Thanks for posting this information.

    Posted by: sunil_gupta20801 on February 29, 2008 at 05:54 PM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds