2

In SWING is there a good/easy 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

LDAdams
  • 682
  • 4
  • 18

3 Answers3

2

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.

kleopatra
  • 51,061
  • 28
  • 99
  • 211
1

I would recommend Trident animation framework. I will simplify proper animation based on the properties of your panel

Eugene Ryzhikov
  • 17,131
  • 3
  • 38
  • 60
1

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.

meverett
  • 921
  • 5
  • 6