I currently have a JScrollPane that holds what is basically a list of items. This JScrollPane is to be displayed on an information screen.
What I'm looking for is some way of making it automatically scroll to the bottom of the list at a given interval, then back to the top. I recognise this is probably not achievable using a JScrollPane, so any suggestions for alternatives would also be great!
Normally I would use the TimingFramework or you could use something like Trident or the Unviversal Tween Engine as a bases for any animation. The main reason is, apart from doing most of the work for you, they also provide variable speed, which will make the animation look more natural.
But you can achieve the basic concept using a
javax.swing.Timer
.This example will allow you to scroll to the bottom of an image and back again.
The animation will take 5 seconds (as supplied by the
runningTiming
variable), allowing it to be variable (the larger the image, the faster the movement, the smaller the image, the slower).Have you looked into using a timer to send scroll instructions to the JScrollPane at intervals? Just the first thing that comes to mind...