Title bar does not scale

49 Views Asked by At

(OS: Windows 10)

I created an EXE file using this config.exe4j file with exe4j.

<?xml version="1.0" encoding="UTF-8"?>
<exe4j version="9.0" transformSequenceNumber="3">
  <directoryPresets config="C:/git/Exe4jUiTest/build/libs" />
  <application name="Exe4j UI Test" distributionSourceDir="C:/dist/Exe4jUiTest" />
  <executable name="Exe4j UI Test" wrapperType="embed" executableMode="gui" checkConsoleParameter="true" dpiAware="true" />
  <java mainClass="org.example.Main" vmParameters="--add-exports=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED           --add-opens=java.base/java.lang=ALL-UNNAMED           --add-opens=java.base/java.util=ALL-UNNAMED           --add-opens=java.base/java.util.concurrent=ALL-UNNAMED           --add-opens=java.base/java.text=ALL-UNNAMED           --add-opens=java.desktop/java.awt=ALL-UNNAMED           --add-opens=java.desktop/java.awt.font=ALL-UNNAMED           --add-opens=java.desktop/javax.swing=ALL-UNNAMED           --add-opens=java.desktop/sun.swing=ALL-UNNAMED           --add-opens=java.base/sun.security.action=ALL-UNNAMED           --add-opens=java.desktop/sun.awt.windows=ALL-UNNAMED           --add-opens=java.desktop/sun.awt.image=ALL-UNNAMED           --add-opens=java.desktop/java.awt.geom=ALL-UNNAMED           -Dsun.java2d.dpiaware=true" minVersion="17" maxVersion="17">
    <classPath>
      <archive location="C:/git/Exe4jUiTest/build/libs/Exe4jUiTest-0.0.1.jar" failOnError="false" />
    </classPath>
  </java>
</exe4j>

The title bar of this application is not adjusted to the scaling of the screen. E.g. if the application window is moved to a screen with 200% scaling...

If the application is ran using the javaw -jar command with the JAR file used in the configuration, the title bar is scaled.

screenshot The screenshot demonstrates this issue using the HelloGui demo of Exe4j application. The screenshot was taken on a monitor set to 225% scaling.

Leaving the scaling to the operatating system fixes the issue with the title bar. But instead the text of the application is blurred.

0

There are 0 best solutions below