Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8296312

Most Swing/AWT widgets do not scale on HighDPI displays, but others DO

XMLWordPrintable

    • x86_64
    • linux

      ADDITIONAL SYSTEM INFORMATION :
      Ubuntu Linux (thus GNOME), OpenJDK 11

      A DESCRIPTION OF THE PROBLEM :
      I have a Swing program called Edisyn (https://github.com/eclab/edisyn) which looks great on MacOS and Windows machines even with HighDPI monitors. But on Linux it is a complete mess: the primary widgets in the GUI (JComboBoxes, JCheckBoxes, JButtons, JLabels, and certain custom-drawn widgets) do not scale with HighDPI and stay teeny-tiny. This would be fixable with an environment variable like GDK_SCALE=2, or setting -Dsun.java2d.uiScale=2.0 say. However the Menus, the JTabbedPane labels, and the widgets drawn inside JOptionPane boxes **do scale**. As a result the application is a mess of different-sized widgets, and scaling everything up just makes the already standard-sized widgets monster-sized.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. On Ubuntu OpenJDK 11, launch download and run https://cs.gmu.edu/~eclab/projects/edisyn/edisyn.jar

      2. When asked, select a synthesizer from the "All Synths" combo box, and press "Open".

      3. Behold

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      All widgets would be scaled in the same way; and that way would be the standard size.
      ACTUAL -
      Menus, tab pane tabs, JOptionPane boxes all are "standard" sized, while everything else (both custom to Edisyn and standard in Java) are tiny.

      FREQUENCY : always


            pnarayanaswa Praveen Narayanaswamy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: