Indeterminate ProgressIndicator should animate if removed from scene and then added back.

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • 8u20
    • Affects Version/s: 8u20
    • Component/s: javafx
    • None

      In testing RT-33261, I set up a simple test where an indeterminate ProgressIndicator was removed from the scene and was then added back. It is reasonable to expect that the ProgressIndicator should be spinning when it is re-added to the scene, but it is not. Only by requesting a layout on the ProgressIndicator after it was re-added could I get the indicator to spin.

          @Override public void start(Stage stage) throws Exception {
              final root = new VBox();
              final ProgressIndicator progressIndicator = new ProgressIndicator(-1);
              progressIndicator.setMaxSize(150, 150);
              progressIndicator.visibleProperty().addListener((b,o,n)->{
                  System.out.println("Main: progressIndicator visibleProperty: " + n);
              });

              Button button = new Button("remove/add");
              button.setOnAction((e) -> {
                  Parent parent = progressIndicator.getParent();
                  if (parent != null) root.getChildren().remove(progressIndicator);
                  else root.getChildren().add(progressIndicator);
      // progressIndicator.requestLayout();

              });
              root.getChildren().addAll(button, progressIndicator);
              Scene scene = new Scene(root, 200,200);
              stage.setScene(scene);
              stage.show();
          }

            Assignee:
            David Grieve
            Reporter:
            David Grieve
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: