Details
-
Bug
-
Resolution: Unresolved
-
P3
-
jfx11, jfx17, jfx18, jfx19
-
x86_64
-
linux_ubuntu
Description
ADDITIONAL SYSTEM INFORMATION :
javafx 19-ea+3, openjdk version "14.0.2", Ubuntu 20.
A DESCRIPTION OF THE PROBLEM :
Please, consider the following code:
public class JavaFxTest4 extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
Button button = new Button();
button.setText("dialog");
button.setOnAction((e) -> {
Dialog<?> d = new Dialog<>();
final Window window = d.getDialogPane().getScene().getWindow();
Stage stage = (Stage) window;
stage.setMinHeight(450);
stage.setMaxHeight(450);
stage.setHeight(450);
stage.setMinWidth(600);
stage.setMaxWidth(600);
stage.setWidth(600);
window.setY(300); //<---- note this line
window.setX(660); //<---- note this line
d.showAndWait();
});
VBox root = new VBox();
root.getChildren().addAll(button);
var scene = new Scene(root, 1920, 1000);
primaryStage.setScene(scene);
primaryStage.show();
}
}
As you can see window position is 660 (x) and 300 (y). And this is the result:
First.png <attached>
Second.png <attached>
As you can see x position is correct, but y position is not. The problem was also discussed on SO - https://stackoverflow.com/questions/72583599/javafx-dialog-y-position-doesnt-work-properly
javafx 19-ea+3, openjdk version "14.0.2", Ubuntu 20.
A DESCRIPTION OF THE PROBLEM :
Please, consider the following code:
public class JavaFxTest4 extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
Button button = new Button();
button.setText("dialog");
button.setOnAction((e) -> {
Dialog<?> d = new Dialog<>();
final Window window = d.getDialogPane().getScene().getWindow();
Stage stage = (Stage) window;
stage.setMinHeight(450);
stage.setMaxHeight(450);
stage.setHeight(450);
stage.setMinWidth(600);
stage.setMaxWidth(600);
stage.setWidth(600);
window.setY(300); //<---- note this line
window.setX(660); //<---- note this line
d.showAndWait();
});
VBox root = new VBox();
root.getChildren().addAll(button);
var scene = new Scene(root, 1920, 1000);
primaryStage.setScene(scene);
primaryStage.show();
}
}
As you can see window position is 660 (x) and 300 (y). And this is the result:
First.png <attached>
Second.png <attached>
As you can see x position is correct, but y position is not. The problem was also discussed on SO - https://stackoverflow.com/questions/72583599/javafx-dialog-y-position-doesnt-work-properly