We are using JDK FX 17 from https://www.azul.com/downloads/#zulu
We build a custom Java runtime image using the following command
jlink --no-header-files --no-man-pages --compress=2 --strip-debug --module-path "C:\Program Files\Zulu\zulu-17\jmods" --add-modules java.base,java.datatransfer,java.desktop,java.logging,java.naming,java.prefs,java.rmi,java.security.sasl,java.sql,java.xml,javafx.base,javafx.controls,javafx.graphics,javafx.media,javafx.swing,javafx.web,jdk.jsobject,jdk.unsupported,jdk.crypto.ec --output jre
However, I notice I am getting different Swing app display quality, by using custom Java runtime image, and system installed Java.
This is how I execute my Java Swing app.
Using custom Java runtime image from jlink
C:\Users\yccheok\Desktop\jstock>jre\bin\java -Dsun.java2d.dpiaware=false -Xms64m -Xmx512m --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED -jar jstock.jar
Here is the Swing app result. (You need to download the image in original size, to notice the UI display is blurry)
Using system installed Java
C:\Users\yccheok\Desktop\jstock>java -Dsun.java2d.dpiaware=false -Xms64m -Xmx512m --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED -jar jstock.jar
If you compare both screenshots, you will notice the system installed Java, produce a Swing UI which is sharper and clearer. (You need to download the image in original size, to notice the UI display is sharp and clear)
Do you know why this is so? How I can fix my jlink output image?