title: Prevent Swing GUI locking up during a background task
body: <p>I have a swing application which stores a list of objects. When the users clicks a button, </p>
  
  <p>I want to perform two operations on each object in the list, and then once that is complete, graph the results in a JPanel. I've been trying SwingWorker, Callable &amp; Runnable to do the processing, but no matter what I do, while processing the list (which can take up to a few minutes, as it is IO bound), the GUI is locked up.</p>
  
  <p>I have a feeling it's probably the way I'm calling the threads or something, or could it be to do with the graphing function? That isn't threaded as it is very quick. </p>
  
  <p>I have to do the two processing stages in order too, so what is the best way to ensure the second one has waited on the first? I've used join(), and then </p>
  
  <pre><code>while(x.isAlive())  
  {  
          Thread.sleep(1000);  
  }
  </code></pre>
  
  <p>to try and ensure this, but I'm worried this could be the cause of my problem too.</p>
  
  <p>I've been looking everywhere for some pointers, but since I can't find any I'm sure I'm doing something stupid here.</p>