I have recently started Java and wondered if it was possible to make Animations whilst using GridBag Layout.
Are these possible and how? Any tutorials, help and such would be greatly appreciated :)
I have recently started Java and wondered if it was possible to make Animations whilst using GridBag Layout.
Are these possible and how? Any tutorials, help and such would be greatly appreciated :)
In order to perform any kind of animation of this nature, you're going to need some kind of proxy layout manager.
It needs to determine the current position of all the components, the position that the layout manager would like them to have and then move them into position.
The following example demonstrates the basic idea. The animation engine use is VERY basic and does not include features like slow-in and slow-out fundamentals, but uses a linear approach.
Update
You could also take a look at AurelianRibbon/Sliding-Layout
This is the program which i did long time back when i just started my
Java
classes.I did simple animations on different tabs onJTabbedPane
(change the path of images/sound file as required),hope this helps:UPDATE:
Sorry about not following concurrency in Swing.
Here is updated answer: