3

I have a java swing application that is deployed using Java web start. Everything appears very small on high dpi displays. I've determined this is because while java reports that it is dpi aware to windows in fact java swing applications are not dpi aware. I've tried setting the dpi aware false in the java.exe, javaws.exe and javaw.exe files without success.

Any suggestions would be appreciated.

Richard Good
  • 71
  • 1
  • 4

2 Answers2

8

Set the property in the resources-section of your jnlp-file. Like, for example, in the following extract:

  <resources>
    <j2se version="1.7+"          href="http://java.sun.com/products/autodl/j2se"          initial-heap-size="128m"          max-heap-size="1024m"/>
    <property name="sun.java2d.dpiaware" value="false"/>
    <jar href="app.jar" main="true"/>
  </resources>

Alternatively running webstart on the command-line you can override properties:

javaws -J-Dsun.java2d.dpiaware=false myapp.jnlp
andygavin
  • 2,784
  • 22
  • 32
0

This worked for me on Windows 10:

  1. Find java.exe or javaws.exe
  2. Right click -> Properties
  3. Go to Compatibility tab
  4. Click "Change high DPI settings"
  5. Check "Override high DPI scaling behavior"
  6. Choose "System" for "Scaling performed by"

Source: https://superuser.com/questions/988379/how-do-i-run-java-apps-upscaled-on-a-high-dpi-display

Ralf
  • 31
  • 4