title: Play Button on a Video Editing program I'm creating not working
body: <p>I'm creating a video editor and it's going well so far. I just need to figure out a way of playing the video frames I have stored in an array and displaying them on a label. This is what I've tried so far, it doesn't work as expected. The video frames do not playback, instead the label displays only the last frame. </p>
  
  <p>I'm just wondering where I'm going wrong or do I need to take a completely different approach to playing these frames. </p>
  
  <p>Frames are captured by a JavaFX ImageView (originally a BufferedImage)</p>
  
  <pre><code> @FXML
  public void playButton() {
      for (int i = 0; i &lt; imageList.size(); i++) {
  
          final int iFinal = i; //Workaround to allow i value to work in inner class
  
          Task task = new Task&lt;Void&gt;() {
              @Override
              public Void call() {
                  try {
                      Thread.sleep((long) (1000 / frameRate));
                      previewBoxLabel.setGraphic(imageList.get(iFinal).getImage());
                      System.out.println("Play");
                  } catch (Exception e) {
                  }
                  return null;
              }
          };
          new Thread(task).start();
      }
  }
  </code></pre>
  
  <p>Thanks for the help in advance :) </p>