<Swing Dev> Ways to cancel SwingWorker running task
ximalaya
ims3g at 126.com
Tue Jul 12 22:15:05 UTC 2011
Hi,
Can I use Thread.stop() to cancel a SwingWorker running task forcely? Though the stop method is documented as deprecated in JDK doc. My thought is, first store the thread in doInBackground, then force stop the thread by invoking thread.stop() later.
The purpose is to guarantee to always stop the task within specified seconds(for example 20s). For some tasks, we can not achieve this goal using approaches, such as checking cancel flag or SwingWorker.cancel(true).
Thanks and Best Regards,
Xmly
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20110713/bbc8dc42/attachment.html>
More information about the swing-dev
mailing list