JDK-8219182 : UI not scaled on HiDPI Linux
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8u201
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86_64
  • Submitted: 2019-02-15
  • Updated: 2019-02-18
  • Resolved: 2019-02-18
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
Ubuntu 18.04

A DESCRIPTION OF THE PROBLEM :
When running a JavaFX application on Ubuntu 18.04, with a 21" 4k screen and the system UI scaling set to 2x, the JavaFX application is still scaled at 1x and everything is tiny.

I've tried manually setting `settings set org.gnome.desktop.interface scaling-factor 2`, but that doesn't change anything. I've also logged out and in again, but that doesn't change anything. I've also tried both Xorg and Wayland sessions, but that doesn't affect anything either.

Screenshot: https://imgur.com/a/5aCopXq

Are there any system properties or VM option that can be set to force JavaFX to render @2x?

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached sample on Ubuntu 18.04 with a high DPI screen

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
JavaFX scales with the rest of the system
ACTUAL -
JavaFX remains at 1x and is tiny

---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class MainWindow extends Application
{
    public static void main(
        final String... args)
    {
        launch(args);
    }
    
    @Override
    public void start(
        final Stage primaryStage)
    {
        final VBox root = new VBox(10);
        root.getChildren().addAll(new Button("Button"), new TextField(), new Label("Label"));
        
        final Scene scene = new Scene(root, 600, 400);
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}
---------- END SOURCE ----------

FREQUENCY : always



Comments
This support has been implemented in JDK 9. So it is suggested to use latest JavaFX 11 (https://openjfx.io/) Closing this as duplicate of JDK-8137050.
18-02-2019