4

有没有办法在 Java中暂停/恢复SwingWorker ?

4

1 回答 1

0

您可以通过实现类似这样的东西来暂停您在 swing worker 中运行的任务

while(true) {
   if(paused)
   {
       try {
           Thread.sleep(500); // half a second
           continue;
       } catch(InterruptedException e)
       {
       }
   }
}

虽然不是很好。

于 2010-10-04T07:32:59.787 回答