-
Bug
-
Resolution: Fixed
-
P3
-
8u20
I've discovered a strange bug with ProgressBar. The bar is positioned in the center of the stage with 50px padding to the stage border.
I've set the width of the stage to 300, which seems to be important for this bug (if I set the width on the Scene, everything is fine).
The progress bar starts its animation at x=0 of the stage, i.e. out of its borders. It should start at x=50 (respect the padding). It disappears at around 30% of the bar (which seems to be the limit as if I didn't specify Double.MAX_VALUE for the max width, i.e. the natural width) and then reappears at the very right edge of the bar (to move to the left again).
It worked well with Java 8u05.
Sample:
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.ProgressBar;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class TestApp4 extends Application {
public static void main(String[] args) {
launch();
}
@Override
public void start(Stage stage) throws Exception {
VBox root = new VBox();
root.setPadding(new Insets(50, 50, 50, 50));
ProgressIndicator progressIndicator = new ProgressBar();
progressIndicator.setMaxWidth(Double.MAX_VALUE);
root.getChildren().addAll(progressIndicator);
Scene scene = new Scene(root);
stage.setScene(scene);
stage.setWidth(400);
stage.show();
}
}
I've set the width of the stage to 300, which seems to be important for this bug (if I set the width on the Scene, everything is fine).
The progress bar starts its animation at x=0 of the stage, i.e. out of its borders. It should start at x=50 (respect the padding). It disappears at around 30% of the bar (which seems to be the limit as if I didn't specify Double.MAX_VALUE for the max width, i.e. the natural width) and then reappears at the very right edge of the bar (to move to the left again).
It worked well with Java 8u05.
Sample:
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.ProgressBar;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class TestApp4 extends Application {
public static void main(String[] args) {
launch();
}
@Override
public void start(Stage stage) throws Exception {
VBox root = new VBox();
root.setPadding(new Insets(50, 50, 50, 50));
ProgressIndicator progressIndicator = new ProgressBar();
progressIndicator.setMaxWidth(Double.MAX_VALUE);
root.getChildren().addAll(progressIndicator);
Scene scene = new Scene(root);
stage.setScene(scene);
stage.setWidth(400);
stage.show();
}
}