title: JavaFX progress bar show file upload status
body: <p>i am using JavaFX (using scene builder) and i am trying to build a progressBar with a progressIndicator that will show a background file upload status.</p>
  
  <p>Here is my javafx controller (some initialization):</p>
  
  <pre><code>@FXML
  private Pane uploadsStatuses;
  @FXML
  private ProgressBar uploadBar;
  @FXML
  private ProgressIndicator uploadProgressIndicator;
  ...
  @Override
  @FXML
  public void initialize(URL url, ResourceBundle rb) {
      ...
      assert uploadsStatuses != null : "fx:id=\"uploadsStatuses\" was not injected: check your FXML file 'FXMLDocument.fxml'.";
      assert uploadBar != null : "fx:id=\"uploadBar\" was not injected: check your FXML file 'FXMLDocument.fxml'.";
      assert uploadProgressIndicator != null : "fx:id=\"uploadProgressIndicator\" was not injected: check your FXML file 'FXMLDocument.fxml'.";
      ...
  </code></pre>
  
  <p>For uploading the file i am using FTP4J library and i have already implemented a way to calculate file upload percentage:</p>
  
  <pre><code>public class Ftp4jListener implements FTPDataTransferListener {
      private int transfBytes=0;
      private int totalBytes=0;
      private long fileSize = -1;
      private String fileName;
      ...
      @Override
      public void transferred(int length)
      {
          transfBytes+=length;
          float percent = (float) transfBytes / this.fileSize;
          float fPercent = percent*100;
          log.info("File: " + this.fileName + " | Bytes transfered "+ transfBytes + " Percentage: " + fPercent + "%");
      }
  </code></pre>
  
  <p>The question is how could i bound FTP4J listener with my progressBar &amp; progressIndicator?</p>