Stages sometimes appear at four times the expected resolution when using retina screens. The issue occurs when a stage is shown on a retina screen while a non-retina screen is in focus.
Reproduction steps:
1) Set the retina screen as the primary screen and connect an external (non-retina) monitor
2) Run the sample code below from an IDE or console that's located on the external (non-retina) monitor.
Result: The button will show at four times the expected size (but the size of the stage is correct).
public class TestRetina extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
Button button = new Button("This is a test");
StackPane stackPane = new StackPane(button);
Scene scene = new Scene(stackPane);
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Reproduction steps:
1) Set the retina screen as the primary screen and connect an external (non-retina) monitor
2) Run the sample code below from an IDE or console that's located on the external (non-retina) monitor.
Result: The button will show at four times the expected size (but the size of the stage is correct).
public class TestRetina extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
Button button = new Button("This is a test");
StackPane stackPane = new StackPane(button);
Scene scene = new Scene(stackPane);
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
- duplicates
-
JDK-8094813 High DPI problem on Retina MBP with external monitor
-
- Closed
-
-
JDK-8095383 Controls on Retina Laptop are magnified when initially opened
-
- Closed
-