-
Bug
-
Resolution: Fixed
-
P3
-
8
-
Java 1.8.0ea b90
When I create a non resizable stage that should be sized to the scene it appears too big on Windows when it is shown. It looks like the window borders change between a resizable and non resizable stage in Windows. The non resizable stage looks like it is too big by the difference in window border size.
Run the supplied test case in Windows and notice the extra white background on the bottom and right sides of the stage. When you click on the blue rectangle the window resizes to the size it should have been shown at.
***********************************************************
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
public class WindowTest extends Application {
@Override public void start(final Stage primaryStage) throws Exception {
Rectangle rect = new Rectangle(600, 400);
rect.fillProperty().set(Color.DODGERBLUE);
rect.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent event) {
primaryStage.sizeToScene();
}
});
primaryStage.setScene( new Scene(new Pane(rect)) );
primaryStage.setResizable(false);
primaryStage.sizeToScene();
primaryStage.centerOnScreen();
primaryStage.show();
}
public static void main(String[] args) throws Exception{
launch(args);
}
}
Run the supplied test case in Windows and notice the extra white background on the bottom and right sides of the stage. When you click on the blue rectangle the window resizes to the size it should have been shown at.
***********************************************************
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
public class WindowTest extends Application {
@Override public void start(final Stage primaryStage) throws Exception {
Rectangle rect = new Rectangle(600, 400);
rect.fillProperty().set(Color.DODGERBLUE);
rect.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent event) {
primaryStage.sizeToScene();
}
});
primaryStage.setScene( new Scene(new Pane(rect)) );
primaryStage.setResizable(false);
primaryStage.sizeToScene();
primaryStage.centerOnScreen();
primaryStage.show();
}
public static void main(String[] args) throws Exception{
launch(args);
}
}
- is blocked by
-
JDK-8118347 Win: Colorpicker rainbow slider provides wrong coordinates
-
- Closed
-