-
Bug
-
Resolution: Duplicate
-
P4
-
8
-
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.
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.
- duplicates
-
JDK-8124468 When child is more css dirty than parent that gets lost
-
- Closed
-
-
JDK-8118282 Progressbar, ProgressIndicator not working
-
- Resolved
-