I found this nice console mode example of watching a directory and it even works!
Watch Directory example
This code looks a little CPU intensive: we are in a nested for loop! Are we actually polling the file system continually? Yikes! In C++ on windows, you set up a call back so you can sleep instead of poll.
Can anyone show me a Swing GUI example that demonstrates this directory watch feature?
Now I did a little google searching with no luck. How would I write a Swing GUI version of this example? Do I have to execute the watchFile function in a child
thread and then use the javax.swing.SwingWorker from java1.6? How would I join with such a thread when I am exiting the application?
Thanks!
Siegfried