title: Java Swing EDT & Concurrency
body: <p>I was just wondering if it is still necessary to ensure synchronicity in an invokeLater() Runnable.</p>
  
  <p>I am encountering deadlock and need to overcome it while maintaining concurrency.</p>
  
  <p>Would this be an example of good code?:</p>
  
  <pre><code>private String text;
  
  private void updateText()
  {
      SwingUtilities.invokeLater(new Runnable()
      {
          public void run()
          {
              synchronized(FrameImpl.this)
              {
                  someLabel.setText(text);
              }
          }
      });
  }
  </code></pre>
  
  <p>Sorry for the rather bad example, but we must assume that <code>text</code> is being modified by different threads, cannot be injected, and is reliant on a correct value.</p>
  
  <p>Is this the proper solution or will I unintentionally create a deadlock problem by sending synchronized code off into an unknown context..?</p>
  
  <p>Thanks.</p>