F
FET
Hi all,
I have an application that displays a Swing GUI. The application
writes its logs to a certain file. I would like to have a thread that
checks the file every, say 10 seconds, and if it is found to be
deleted, creates a new file. I have made a class that extends
TimerTask and in the run method, it calls file.exists() and
file.createNewFile(). Then I have set timer.schedule ( task, 0,
10000). But the code never gets called.
Should I just use plain ol' awt threads ? I think Timers is a more
sophisticated mechanism. But it doesn't seem to be working.
Please advise.
Thanks in advance.
Best regards.
I have an application that displays a Swing GUI. The application
writes its logs to a certain file. I would like to have a thread that
checks the file every, say 10 seconds, and if it is found to be
deleted, creates a new file. I have made a class that extends
TimerTask and in the run method, it calls file.exists() and
file.createNewFile(). Then I have set timer.schedule ( task, 0,
10000). But the code never gets called.
Should I just use plain ol' awt threads ? I think Timers is a more
sophisticated mechanism. But it doesn't seem to be working.
Please advise.
Thanks in advance.
Best regards.