Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

enable transitions on java image change

I'm writing a small application which aims to display a catalogue on screen. The window is splitted in three main blocks: On the left I have the articles' list, on the right a panel for image rendering and under this last component I have some labels for the information.

Now when I select an article I paint the image on the panel and fill the information's into the labels. When I have more than one image associated with the selected article I start a swing timer and I swap the images Evey 5 seconds...

How can I make the photo change more pretty introducing some fancy animations on image change? Do you know any library that could me help? If you do that directly by code an example and a little explanation would be great.

Thanks in advance Marco

like image 731
Marco Capoferri Avatar asked Sep 05 '26 07:09

Marco Capoferri


1 Answers

You can do some basic animation pretty easily with basic Java2D features, but it will take some more effort to add something actually interesting.

You can check out my own library demo (source included) for the ImageTransitionPanel example - it allows to perform a transition between two different Swing components with some interesting animations:
Web Look and Feel demo

There is also a full source of the ImageTransitionPanel included in the demo and sources. That class basically creates all of the transition effects and performs the transition.

like image 98
Mikle Garin Avatar answered Sep 07 '26 20:09

Mikle Garin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!