title: Java Backgroundworker: Scope of Widget to be updated unclear
body: <p>I am trying to understand the mechanism of <code>org.jdesktop.swingx.BackgroundWorker</code>. Their <a href="http://swinglabs.org/hudson/job/SwingX-WS%20Continuous%20Build/javadoc/org/jdesktop/swingx/BackgroundWorker.html" rel="nofollow noreferrer">javadoc</a> presents following example:</p>
  
  <pre><code>final JLabel label;
  class MeaningOfLifeFinder implements BackgroundListener {
      public void doInBackground(BackgroundEvent evt) {
          String meaningOfLife = findTheMeaningOfLife();
          evt.getWorker().publish(meaningOfLife);
      }
  
      public void process(BackgroundEvent evt) {
          label.setText("" + evt.getData());
      }
  
      public void done(BackgroundEvent evt) {}
      public void started(BackgroundEvent evt) {}
  }
  
  (new MeaningOfLifeFinder()).execute();
  </code></pre>
  
  <p>Apart from the fact that I doubt the result will ever get published, I wonder how <code>label</code> is passed to the process method, where it is being updated. I thought its scope was limited to the outside of the BackgroudListener implementation. Quite confused I am ... any answers for me?</p>
  
  <p>Thanks in advance</p>