The drop shadow dialog/frame from the last article is indeed not something to use everywhere.
There is one situation although I like to use it:
While opening a dialog over a JFrame, a gray filter is applied over the JFrame using JXLayer, the gray filter is of course faded in using a fast animation (500ms => the same time it take for the dialogWithDropShadow to fade in). I really like the result, it makes the dialog really stand out, and make the user focus on it.
Launch the web start demo to see the animation.
The fade in of the gray filter is done by animating the alpha property in the ColorLayerUI class.
This ColorLayerUI is really simple; it’s just paint a grey rectangle in the paintLayer method.
Subscribe to:
Post Comments (Atom)
Hmm, Neat idea. I like the look of it.
ReplyDeleteHowever, when I ran the app, the JFrame popped up in the top right-hand corner of my screen, so I moved it into the middle. Then I pressed the "show dialog" button. The JFrame greyed out and the dialog popped up but the dialog appeared to the left of the JFrame.
Something like this:
[pre]
+--------+
|.Dialog.|....+--------------+
+--------+....|.JFRame.......|
..............|..............|
..............|..............|
..............+--------------+
[/pre]
Thanks for pointing it out, i fixed it
ReplyDeleteBut controls are still clickable as well as you can do anything, even close the back main frame.
ReplyDeletemy mistake the dialog was not set modal.
ReplyDeleteShould be fixed now.
Thanks