Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8122214

ProgressIndicator takes a long time to switch to Done (sometimes)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 8
    • javafx
    • None
    • OS X 10.8, Macbook Air 2012, JDK8b113

      If I switch a ProgressIndicator from indeterminate to 100% complete (done), sometimes it will switch straight away, but most of the time, the GUI will hang without updating for a few seconds before switching to done.

      I hope this can be replicated on one of your systems. When I try to capture the behaviour for a screen cast, it works smoothly every time, which is quite strange.

      --------

      Sample code: spins for 5 seconds, then switches the progress to 1 (done).

      import javafx.animation.PauseTransition;
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.ProgressIndicator;
      import javafx.stage.Stage;
      import javafx.util.Duration;

      public class ProgressTrack extends Application {

          @Override public void start(Stage stage) throws Exception {
              ProgressIndicator indicator = new ProgressIndicator();

              stage.setScene(
                  new Scene(
                      indicator
                  )
              );
              stage.show();

              PauseTransition delay = new PauseTransition(Duration.seconds(5));
              delay.setOnFinished(e -> indicator.setProgress(1));
              delay.play();
          }

          public static void main(String[] args) { launch(args); }
      }

            kcr Kevin Rushforth
            josmithjfx John Smith (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: