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

Java Swing Applications are not scaled in Windows

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_7

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_131"
      Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
      Java HotSpot(TM) Client VM (build 25.131-b11, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      Java Swing applications are not scaled according to the windows' system settings.

      There was a flag in 1.6 like this:
      -Dsun.java2d.dpiaware=false

      This does not work anymore.

      So we do not have the possibility to deliver a swing application that does scale how it should.
      I really like to decide on my own whether the application is scaled or not.
      So please reintroduce the flag again or find some other solution.

      This bug here is open for 2 years:
      https://bugs.openjdk.java.net/browse/JDK-8080153

      REGRESSION. Last worked in version 6u45

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.) use windows 7/8/10
      2.) set display scaling to e.g. 150%
      3.) create an arbitrary litte application just shown an JFrame



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      there should be an flag like:
      -Dsun.java2d.dpiaware=false
      or something similar
      ACTUAL -
      no way to deliver an application, that scales correctly, how we define it.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      There are three workarounds currently:

      1.) open the properties on the java.exe and javaw.exe. Check the compatibility and switch the dpi scaling from "application to "system"
      This is quite annoying, because every user of our software needs to do this.

      2.) open the javaw.exe or java.exe with a resource editor tool, and change the manifest file by setting the value "dpiAware" to false.
      This is not allowed because it would be a breach of lisense agreement.

      3.) force Windows to prefer external manifests. Create manifest files for the java.exe and javaw.exe.
      This is also cumbersome and may be a security issue.


        Attachments

        1. HelloWorldSwing.java
          1.0 kB
        2. image002.png
          image002.png
          94 kB
        3. image003.jpg
          image003.jpg
          90 kB
        4. Result-6u45_7u80_8u131_9eab170.png
          Result-6u45_7u80_8u131_9eab170.png
          212 kB

          Issue Links

            Activity

              People

              • Assignee:
                scfitch Stephen Fitch
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: