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

Numerous swing display problems with scaled displays on Windows

    Details

    • Subcomponent:
      2d
    • Introduced In Version:
      9
    • Resolved In Build:
      b34
    • CPU:
      x86_64
    • OS:
      windows_7

      Description

      FULL PRODUCT VERSION :
      java version "9"
      Java(TM) SE Runtime Environment (build 9+181)
      Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]


      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Display scaling at 170%

      A DESCRIPTION OF THE PROBLEM :
      Swing applications now look bad with a scaled display on Windows.

      The comments to 8187151 claim that this is not due to a problem with dpi awareness.

      See http://www.jgrasp.org/tmp/scale.png which shows a file chooser under Java 9 and Java 8 with 170% display scaling.

      The file chooser under Java 9 has odd white lines near the right sides of the buttons and scrollbar, differing appearance of identical icons (even if the images don't scale well, the icons should all look the same), badly scaled icon images (more image sizes need to be provided if that is what is happening, or they need to be drawn on-the-fly). The borders of the combo boxes do not look right. The triangle icon on one of the combo boxes and on the scroll bar are asymmetrical.

      All swing applications will look bad at this scaling level.

      REGRESSION. Last worked in version 8u152

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run the code on a system with 170% display scaling.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Normal-looking file chooser dialog (though possibly larger than under Java 8).
      ACTUAL -
      Badly rendered file chooser dialog.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      import java.io.File;

      public class DpiAwareBug {
         public static void main(String args[]) {
            SwingUtilities.invokeLater(
               new Runnable() {
                  public void run() {
                     JFileChooser fc = new JFileChooser();
                     fc.showOpenDialog(null);
                  }
               });
         }
      }

      ---------- END SOURCE ----------

        Attachments

        1. 9.PNG
          9.PNG
          27 kB
        2. DpiAwareBug.java
          0.4 kB
        3. 8u144.PNG
          8u144.PNG
          50 kB
        4. SwingSet2.png
          SwingSet2.png
          53 kB

          Issue Links

            Activity

              People

              • Assignee:
                ssadetsky Semyon Sadetsky (Inactive)
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: