-
Bug
-
Resolution: Unresolved
-
P3
-
8u60, 9, 10
-
x86_64
-
linux_ubuntu
FULL PRODUCT VERSION :
java version " 1.8.0_60"
Java(TM) SE Runtime-Environment (build 1.8.0_60-b27)
Java Hotspot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Ubuntu 14.04.3 LTS
EXTRA RELEVANT SYSTEM CONFIGURATION :
Ubuntu is running on a virtual machine created with Oracle Virtual Box.
A DESCRIPTION OF THE PROBLEM :
A JavaFX window (or a stage) is resizable by default. After a dialog is opened and closed the window can't be resized anymore and every attempt to do it with the mouse just moves the window. This only happens in Ubuntu. It works as expected in Windows.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Use the included sample code to reproduce the bug. Create a java file, compille and run it in Ubuntu. When the application starts verify that the window is resizable. Click on the button to show an alert dialog and close the dialog. Then try to resize the window again. Notice that is not important which dialog is shown. I originally saw the problem after showing an Open File dialog.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The window should remain resizable for the lifetime of the application.
ACTUAL -
The window stops being resizable after a dialog is shown.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
No error messages are shown.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class StageTest extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("Hello World!");
Button btn = new Button();
btn.setText("Show Alert");
btn.setOnAction(e -> {
Alert alert = new Alert(AlertType.WARNING, "This is an alert", ButtonType.YES);
alert.showAndWait();
});
StackPane root = new StackPane();
root.getChildren().add(btn);
primaryStage.setScene(new Scene(root, 1000, 850));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
java version " 1.8.0_60"
Java(TM) SE Runtime-Environment (build 1.8.0_60-b27)
Java Hotspot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Ubuntu 14.04.3 LTS
EXTRA RELEVANT SYSTEM CONFIGURATION :
Ubuntu is running on a virtual machine created with Oracle Virtual Box.
A DESCRIPTION OF THE PROBLEM :
A JavaFX window (or a stage) is resizable by default. After a dialog is opened and closed the window can't be resized anymore and every attempt to do it with the mouse just moves the window. This only happens in Ubuntu. It works as expected in Windows.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Use the included sample code to reproduce the bug. Create a java file, compille and run it in Ubuntu. When the application starts verify that the window is resizable. Click on the button to show an alert dialog and close the dialog. Then try to resize the window again. Notice that is not important which dialog is shown. I originally saw the problem after showing an Open File dialog.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The window should remain resizable for the lifetime of the application.
ACTUAL -
The window stops being resizable after a dialog is shown.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
No error messages are shown.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class StageTest extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("Hello World!");
Button btn = new Button();
btn.setText("Show Alert");
btn.setOnAction(e -> {
Alert alert = new Alert(AlertType.WARNING, "This is an alert", ButtonType.YES);
alert.showAndWait();
});
StackPane root = new StackPane();
root.getChildren().add(btn);
primaryStage.setScene(new Scene(root, 1000, 850));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
- duplicates
-
JDK-8163077 Cannot resize stage after showing file chooser
-
- Closed
-