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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • 8u20
    • 8u20
    • javafx
    • None

    Description

      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();
          }

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported: