Is there any way to animate a JSlider and a JProgressBar?

Hi all,
I'm working on an assignment using JSliders and JProgressBars in a Java application. I've been trying to let my JSlider and JProgressBar move by itself i.e. reset the slider's current value to a new one after a specific period of time...Tried using a timer and thread but just can't seem to get it moving. Is there any way to set the JSlider to update itself after a specified time period? Same goes for JProgressBar?
At my wits' end, really appreciate if anyone can offer me some advice and help...Thanks.

Hmm...use a timertask that resets the value and triggers a repaint in the event thread? That should work at least in theory.

Similar Messages

Maybe you are looking for