title: JList setListData threading issues
body: <p>I'm loading contents of a file to <code>JList</code> component. If I do the loading in main thread, everything seems to be OK - contents are loaded. But when I move loading code to separate thread, select an item in a list and try to reload the list, I get random <code>NullPointer</code> or <code>IndexOutOfBounds</code> exceptions. I'm sure this is some kind of Swing threading issue, but can't determine what.</p>
  
  <p>This is my thread code:</p>
  
  <pre><code>@Override
  public void run() {
      List&lt;String&gt; textLines = null;
      textLines = splitter.split(model.getLedMaxChars(), textLoader.loadText(file));
      listener.onTextLoaded(textLines);//listener is in main Swing code
  }
  </code></pre>
  
  <p>Controller is responsible for listening:</p>
  
  <pre><code>@Override
  public void onTextLoaded(List&lt;String&gt; textLines) {
      view.fileLoaded(model.getCurrentFile());
      view.setTextLines(textLines);
      view.enableListComponent();
  }
  </code></pre>
  
  <p>And the view updates:</p>
  
  <pre><code>public void setTextLines(List&lt;String&gt; textLines) {
      jList.setListData(textLines.toArray());
  }
  </code></pre>
  
  <p>I've tried to leave thread to hang by adding <code>while(true);</code> loop - then everything works OK. If I hit reload without selecting item in a list, everything works too.</p>
  
  <p>Could anyone explain what I'm missing here?</p>