Reputation: 57222
I have a Swing application and I'm trying to fade out the main application and show a window saying an operation is in progress (this is for long running operations that may need to block the UI). Is there an elegant way to do this in Swing (mainly the fading out the background) or maybe some swing library to help with this (maybe from swing labs)?
Thanks,
Jeff
Upvotes: 2
Views: 2051
Reputation: 9446
Kirill Grouchnikov has some excellent articles on transparent and shaped windows (sorry, I'm not allowed to post proper hyperlinks yet):
I've successfully used Kirill's Trident animation and timeline library (kenai.com/projects/trident/pages/Home) to fade out a window, although you have to do a bit of mucking around to capture all the mouse enter/exit events since components displayed in the window will consume them otherwise.
Upvotes: 0
Reputation: 28623
You can use the glass pane for this, see
http://java.sun.com/docs/books/tutorial/uiswing/components/rootpane.html
Upvotes: 0
Reputation: 324207
The latest version supports Transparent Windows. I don't use that version, but I would guess you can use a Timer to gradually change the opacity.
Upvotes: 2