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

ProgressBar and ProgressIndicator disappear when progressProperty is updated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 8
    • 8
    • javafx
    • Win 7 , HP Pavilion dv6-6c35dx, AMD A8-3520M APU with Radeon(tm) HD Graphics × 4, jdk8-ea-b80

      In the latest early-access build, 1.8.0-ea-b80, when you update the progressProperty of a ProgressBar or ProgressIndicator it vanishes. The progress bar goes entirely blank, the indicator continues to display the number with the percent sign (eg. "67%") but the pie chart disappears. Here is a simplified example that reproduces the issue:

      package sample;

      import javafx.application.Application;
      import javafx.concurrent.Task;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.control.*;
      import javafx.stage.Stage;

      public class Main extends Application {

          @Override
          public void start(Stage primaryStage) throws Exception{

              Group root = new Group();
              Task task = new Task<Void>() {
                  @Override public Void call() {
                      final int max = 1000000;
                      for (int i=1; i<=max; i++) {
                          if (isCancelled()) {
                              break;
                          }
                          System.out.println(i);
                          updateProgress(i, max);
                      }
                      System.out.println("Done");
                      return null;
                  }
              };

              ProgressIndicator ind = new ProgressIndicator();
              ind.progressProperty().bind(task.progressProperty());
              root.getChildren().add(ind);
              new Thread(task).start();

              primaryStage.setTitle("Hello World");
              primaryStage.setScene(new Scene(root, 300, 275));



              primaryStage.show();
          }


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

      I extracted caspian.css from the jfxrt.jar of jdk7, copied it into my src folder and applied it to this example, to see if the css was where the issue was, and that definitely was the case.

            jasper Jasper Potts (Inactive)
            ekendojfx Edub Kendo (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: