SWING JPanel / JXPanel Animation
In SWING is there a good/eas开发者_StackOverflowy way of animating a the show and hide of a JPanel? I would like animate the expand of a JPanel height. I figured I could use a timer and increment the height, but was hoping there was something already out there.
Here is an example: (I know this is a web app.... sry). Click Login at the top. http://web-kreation.com/demos/Sliding_login_panel_jquery/#
Thanks
SwingX comes with a JXCollapsiblePanel which might be helpful. Its demo shows it in action (as taskPanes) at the left - that's the part for choosing the demos.
I would recommend Trident animation framework. I will simplify proper animation based on the properties of your panel
I'd recommend the TimingFramework: http://java.net/projects/timingframework/
It was written by some of the guys from the Swing team before the left a few years ago.
If you really want to look into this in some detail I would recommend picking up Filthy Rich Clients by Chet Hausse and Romain Guy. It's the definitive book about how to do fancy things in a Swing app.
精彩评论