0 Replies Latest reply on Jul 21, 2015 2:38 AM by Yuki Okubo

    JavaFX of ProgressBar does not updated

    Yuki Okubo

      Environment: Java SE (Java 8 Update 40) on Windows 7

       

        tracker = new TrackBackupService();
        tracker.setOnReady((WorkerStateEvent e) -> {
        backupUserCancelled = false;
        });
      
        tracker.setOnScheduled((WorkerStateEvent e) -> {
        backupProgressBar.progressProperty().bind(tracker.progressProperty());
        backupPathInProcessingLabel.textProperty().bind(tracker.pathInProcessingProperty());
        backupWorkDoneLabel.textProperty().bind(tracker.workDoneProperty().asString("%.0f"));
        backupTotalWorkLabel.textProperty().bind(tracker.totalWorkProperty().asString("%.0f"));
        backupSelectTargetButton.disableProperty().bind(tracker.runningProperty());
        backupWarningMessageLabel.visibleProperty().bind(tracker.runningProperty());
        backupStartButton.disableProperty().bind(tracker.runningProperty());
        backupStopButton.disableProperty().bind(Bindings.not(backupStartButton.disableProperty()));
        backupSizeLabel.textProperty().bind(tracker.totalSizeProperty());
        backupDirectoryCountLabel.textProperty().bind(tracker.directoryCountProperty().asString());
        backupFileCountLabel.textProperty().bind(tracker.fileCountProperty().asString());
        backupResultLabel.textProperty().bind(tracker.messageProperty());
        });
      


      Run this code there are times when the progress bar is not updated as well.

      However, the progress bar is updated when you display again window after you minimize the window.