Good day everybody!
I need a piece of advice on how to stop SwingWorker because using cancel(true) method doesn't work out.
Here's the outline: everyting runs fine. When I push the button on the UI (i.e. call the cancel(true) method) the program keeps running as if nothing has happened and runs safely till the very last calculation.
Furthermore, I've inserted a beeper into the done() method so that it beeps every time done() is called. And, surprisingly for me, it beeps every time I push the button (i.e. call the cancel() method).Afterwards the program keeps running and then it beeps at the end. I don't get it, why it beeps after I push the button if calling a done() method should imply the end of SwingWorker?
And what's more important to me, how can I interrupt the SwingWorker in this case?
I'd be grateful for any help.