dcsimg
drawing graphics with threads
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rafael_Barioni
Posted On:   Wednesday, August 21, 2002 11:03 AM

Hi everyone.

I´m using JFreeChart to draw graphics in JAVA, and I need to develop a graphic that is refreshed each 5 minutes, for example.
I guess the best way to do this is using threads, but i´m not very much familiar with threads.

Please help me.

Thanx

Re: drawing graphics with threads

Posted By:   Andrew_York  
Posted On:   Friday, August 23, 2002 12:30 PM

Look here:



http://java.sun.com/products/jfc/tsc/articles/timer/



It should help. There is a Timer class with Swing just for what you are tyring to do.

Re: drawing graphics with threads

Posted By:   Eric_Lindauer  
Posted On:   Wednesday, August 21, 2002 04:11 PM

The thing you may be searching for is the Thread.sleep () command. So you're program might look like this:




public void print () throws InterruptedException {
while (true) {
print ();
Thread.sleep (5 * 60 * 1000);
}
}




Hope this helps.

-Eric
About | Sitemap | Contact