I wrote a
Java applet that used the Java 6 SwingWorker class. It needed to perform a long-running task which updates the GUI as it progresses AND has the ability to be paused and resumed as many times as the user likes.
Unfortunately, I also need to cater to users who might have a Java 1.5 browser plugin, so I rewrote quite a bit of the applet to get it running using a the older SwingWorker class (
http://java.sun.com/products/jfc/tsc/articles/threads/src/SwingWorker.java) which was NOT part of the API. It is quite different to the API version but I did get a version working properly when tested with appletviewer.
The problem is that once I use this SwingWorker version with a browser, particularly with a Java 1.5 plugin, the applet sometimes hangs after pause and resume is used. Sometimes.
I suspect that when the applet hangs, it is after the interrupt had been fired during a particular activity in the long running process, perhaps file I/O.
Can anyone comment on this behaviour or provide any insight? I would also appreciate an opinion on the widsom (or lack of) getting rid of the (older) SwingWorker class and trying to program the worker
thread by hand.
Thanks