Trying to stop swingworker

前端 未结 4 1710
面向向阳花
面向向阳花 2020-12-20 08:52

I have a custom JDialog that pops up when my SwingWorker thread fires up. The dialog just has a JProgressbar and a Button (cancel button). I am trying to figure out how to c

4条回答
  •  情书的邮戳
    2020-12-20 09:12

    As explained in the official documentation, you need to check isCancelled() in your SwingWorker callback method.

提交回复
热议问题