title: Adding items to ListView in JavaFx... threading?
body: <p>I'm trying to add a string to ListView in JavaFX whilst processing, but it keeps freezing my GUI.</p>
  
  <p>I've tried the following threading - but can't seem to get it to work for a ListView.<br>
  Does anybody know how/have an example of how I can update a ListView in JavaFX whilst processing data?</p>
  
  <pre><code>new Thread(new Runnable() {
      @Override public void run() {
          for (int i=1; i&lt;=1000000; i++) {
              final int counter = i;
              Platform.runLater(new Runnable() {
                  @Override public void run() {
                      recentList.getItems().add(Integer.toString(counter));
                  }
              });
          }
      }}).start();
  </code></pre>