My application uses the SwingWorker utility class for multi-threading. I'm having an issue in which a user can click "cancel", and the swingworker thread is interrupted, but the user must still wait -- staring at the hour glass -- for the process that thread kicked off to complete on the server. Now, true to thread interruption (and correct me if I'm wrong), the client has no effect on the server completing its process, and the process simply returns no results to the client (or not to the UI at least). This is fine with me, but I'd like for my users to be able to continue working after clicking the cancel button.
So I threw in a call to
After the thread is killed, but something still seems to take over control and throw up the hour glass again, until the server process is complete.
I know this by viewing the log4j output. See below:
That is all fine, typical processing until the user now clicks cancel and kills the thread
At this point, I'd expect the user to be given their control back, but instead the hour glass prevents them from having control until after the next, big, process completes. I can't control Thread 1310 (the server process) so it should be assumed it will run out, but how can I ignore this from the client and allow the user to continue working? Is something in Swing taking the focus and setting the hour glass to wait for this 1310 thread despite the swingworker thread (who launched Thread 1310) was interrupted?