title: Issue with swingworker resuming
body: <p>I am having some trouble with my swingworker thread, and the issue is when i cancel. Essentially, I have a a start button, which when clicked runs my swingworker. </p>
  
  <p>From here my swing worker does a number of small things but the main thing is that it completes some long running reflection calls. </p>
  
  <p>I also have a cancel button - which as you probably guessed cancels my swingworker. The issue however is that I have a bug which I just cannot pinpoint. </p>
  
  <p>After cancelling the application mid way through its first run, the swing worker cancels perfectly, however, if i then click start again and let it run all the way through when it completes - the thread seems to pick back up from where i cancelled on the first run :/ . I have no idea why this is and it apepears as if the cancelled thread is resuming and actually remembering state. I know this is happening because on my gui I have a JLabel that says "processing element 1 of 15..." and it jumps back to the cancelled point.</p>
  
  <pre><code>public class Test
  {
      private SwingWorker&lt;Object, Integer&gt; swingworker = initiate(); 
      private void startListener()
      {
          start.addActionListener(new ActionListener ()
           {    
              public void actionPerformed(ActionEvent  e) 
              {             
                  runIt();  
              }
          }); 
      }
  
      private void runIt()
      {
          try
          {
              if(swingworker .isDone())
                  swingworker = getSwingWorker();
  
              swingworker.execute();
          }
          catch (HeadlessException e) { } 
          catch(Exception e){LogFileWriter.log(e);}
      }   
  
  
      private SwingWorker&lt;Object, Integer&gt; getSwingWorker()
      {
          return new SwingWorker&lt;Object, Integer&gt;() 
          {
              Object o;
  
               protected Object doInBackground() throws Exception 
               { 
                   //do some short calcs
                   doLongCalc();
                   return o;
               }
  
               protected void done()
               { 
                   if(!swingworker .isCancelled()) {} //chnage the gui values like enable / disable button } 
                   else{}//it was cancelled so stop progress bar and stuff
  
               }
          };   
      }
  
      private void cancelListener()
      {
          cancel.addActionListener(new ActionListener ()
           {    
              public void actionPerformed(ActionEvent e) 
              {
  
                  if(swingworker.getState() == SwingWorker.StateValue.STARTED || swingworker.getState() == SwingWorker.StateValue.DONE)
                  {
                      swingworker .cancel(true);
                  }
              }
          }); 
      }
  
      private void doLongCalc()
      {
          //wrap the taks in checks for cancelled or not
          if(!swingworker.isCancelled())//do something
          if(!swingworker.isCancelled())//do something
          if(!swingworker.isCancelled())//do something
          if(!swingworker.isCancelled())//do something
      }
  }
  </code></pre>