title: How cancel the execution of a SwingWorker?
body: <p>Currently I have two SwingWorker threads doing job on background. If an exception occurs, the method stop to work, but the thread still runnig. </p>
  
  <p>How I do to stop the execution and kill the thread of the <code>doInBackground()</code> if an exception occurs?</p>
  
  <p><code>this.cancel(true)</code> don't destroy/close the thread. How can I achieve this?</p>
  
  <pre><code>@Override
  protected Boolean doInBackground() throws Exception {
          try {
              while (true) {
                  //some code here                   
                  return true;
              }
          } catch (Exception e) {       
              this.cancel(true); //&lt;-- this not cancel the thread               
              return false;
          }
      }
  </code></pre>
  
  <p>I see these threads in the debug of Netbeans.</p>
  
  <pre><code>'AWT-EventQueue-0' em execução
  'AWT-Windows' em execução
  'SwingWorker-pool-1-thread-1' em execução
  'SwingWorker-pool-1-thread-2' em execução
  
  //*em execução = in execution
  </code></pre>