Last week I had some fun playing around with the “Undecorator” classes from Arnaud Nouard. I was looking into it because I was thinking about writing a JavaFX showcase application that integrates / lists the various resources available for JavaFX development. My goal for this application is to come up with something very slick and sexy, something unconventional, something with a lot of animations and cool effects. So I started by taking over full control of the appearance of the stage by using “Undecorator”.
With the apperance of Yosemite transparent stages / windows are the way to go so I wanted that, too. I modified Arnaud’s CSS files to make the window transparent and then added a pane that contains 12 large icons for a menu.
The icons are animated when the user clicks on one of them. They shrink and are relocated to the toolbar area at the top of the window. This is done via the standard Timeline class of JavaFX. The key values added to the timeline modify the layout x and y coordinates of the icons based on target bounds that are calculated whenever the width or height of the stage changes.
The result can be seen in the video below.
If anyone knows how to nicely add a blur / frozen glas effect to the background then please let me know.
jewelsea has something for you on Stackoverflow: http://stackoverflow.com/questions/22622034/frosted-glass-effect-in-javafx
The solution mentioned at stackoverflow does not work well enough. It causes flickering as the window is first hidden, then a screenshot of the background is taken, then the window is shown again. The example shows a non-resizable window. Once it is resizable the solution definitely does not work anymore as the background would need to be “snapshot” many times during the resize.
Sorry to hear that. I just remembered that solution and thought it might help you out.
No worries. It does indeed sound like a perfect solution.
Anyone having problem with flickering? Is there any way to resolve it?
I’ve created my own undecorated but it still flickering when I resize for N, W ,NW.
please can you send me the code source ?
[…] https://dlemmermann.wordpress.com/2014/11/17/javafx-tip-16-undecorated-transparent-stages/ […]