title: Perform a Progress Indicator in a background task javafx
body: <p>During the execution of the task the progress indicator runs smoothly , but when the task ends the progress indicator continues to turn . I wish the end of this task the progress indicator stops. Here is my code </p>
  
  <pre><code>nextButton.setDisable(true);
  task = createWorker();          
  progressInd.progressProperty().bind(task.progressProperty());
  th = new Thread(task);          
  th.start();                     
  </code></pre>
  
  <p>and there is my task.</p>
  
  <pre><code>public Task createWorker() {
      return new Task() {
          @Override
          protected Object call() throws Exception {
              list = new LinkedList&lt;BufferedImage&gt;();
              list = vX.getFrame(path.getText());
              System.out.println(list.size());
              vX.getCorruptedImage((LinkedList&lt;BufferedImage&gt;) list);
              progressInd.progressProperty().unbind();
              progressInd.setProgress(task.getProgress());
              nextButton.setDisable(false);
              return output;
          }
      };
  }
  </code></pre>