Is there a way to pause/resume the SwingWorker [duplicate]
-
27-09-2019 - |
Question
This question already has an answer here:
- Pausing SwingWorker 1 answer
Is there a way to pause/resume the SwingWorker in Java ?
Solution
You can pause the task you run in the swing worker by implementing something like this
while(true) {
if(paused)
{
try {
Thread.sleep(500); // half a second
continue;
} catch(InterruptedException e)
{
}
}
}
It is not very nice though.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow