private void bindProgressBar ( final ServiceTaskBase < ? > task , final ProgressBar progressBar ) { // Perform this binding into the JAT to respect widget and task API JRebirth . runIntoJAT ( "Bind ProgressBar to " + task . getServiceHandlerName ( ) , ( ) -> { // Avoid the progress bar to display 100% at start up task . updateProgress ( 0 , 0 ) ; // Bind the progress bar progressBar . progressProperty ( ) . bind ( task . workDoneProperty ( ) . divide ( task . totalWorkProperty ( ) ) ) ; } ) ; }
Bind a task to a progress bar widget to follow its progression .