News:

Precision Simulator update 10.195 (15 September 2026) is now available.
Navburo update 13 (23 November 2022) is now available.
NG FMC and More is released.

Main Menu

Newer Java versions and and high-DPI monitors on Windows

Started by Will, Sat, 21 Aug 2021 13:50

Will

Hi everyone,

I recently upgraded from Java 8.1 to Java 16, and I'd like to share an observation that may be relevant to high resolution monitors under Windows 10.

With Windows 10, the user has the option to scale the display resolution for high-DPI monitors. A typical user setting might be scaling to 150%-200% depending on the monitor. Under display settings, Windows usually suggests a scaling factor based on the monitor's detected resolution; without this scaling (e.g. at 100%), desktop icons, some graphics, and some fonts may be impossibly small and hard to read. With the scaling activated (e.g. 150%), apps can still take advantage of high-resolution monitors but fonts, frames, and desktop icons are large enough to be readable.

With Java 8 and lower, Java takes preferred user scaling into consideration. This means that Java apps such as PSX and its add-ons will be scaled per the user preference defined in Windows settings. This is not a problem; with 150% scaling the Java graphics are slightly lower-resolution than native 100%, but with the advantage of slightly increased performance.

After I recently upgraded Java, I noticed that this scaling is no longer automatic. Without the scaling, PSX and Java add-ons automatically run at 100%, which means maximal crispness in the graphics, but with a performance hit. On my low-end, cheap Windows computer, the difference on a CPU-intensive PSX test situ is between 30+ fps with no scaling, and 50+ fps at 150% scaling. Clearly, scaling affords better performance.

Therefore, I'd like to share a method to restore user-defined display scaling for high-DPI monitors, should anyone with a higher Java version feel a need to do this.

First, find the .exe file that Java calls. If you are unsure, you can load PSX (or any other JAR file) and go to the Task Manager, and right click on "Java(TM) Platform SE binary" and select "Open File Location."

Then, once you've found the Java executable, right click on that file, go to Properties > Compatibility > Change High DPI settings, and check the box called "Override high DPI scaling behavior." Then under "Scaling performed by:," choose "System (Enhanced)."

Having done this, the automatic scaling of Java apps will now be selected via your preferred Windows display resolution, instead of Java apps running at 100% all the time without taking your display preference into account. Doing this gave me my speed advantage back. Your mileage may vary.

I hope someone finds this useful!
Will /Chicago /USA

Mariano

Thank you, Will.

I am running PSX on Windows 8 with Java version 8, update 45. From your post, I understand that when running PSX, Java takes into consideration my display scaling setting under Windows.

Just in case, I tried your procedure in order to check that this is the case, but could not find the "Properties > Compatibility > Change High DPI settings" option. I assume this is because I am running Java version 8. Is this correct?

Can I assume then that Java is using my Windows-selected DPI settings when running PSX?

Thanks again for the helpful insight.

Best regards,

Mariano

Will

Hello Mariano,

Yes, that is my understanding: you are using a version of Java that always adapts to the display scaling you have selected in Windows.

You can test this by going into your Windows display settings and changing scaling from 100%, to 150%, to 200%, and running PSX (or any JAR app) each time. With each increment, PSX should get a tiny bit softer, with the sharpest rendering at 100% and the softest at 200% (or more). That was what I was seeing on Java version 8.

The tip I shared was for higher versions of Java, where the Java app display resolution disregards your Windows display settings unless you carry out the tip as described.

One caveat is that I only have Windows 10. If things work differently in Windows 8, I would not know about it.
Will /Chicago /USA

Mariano

Thanks, Will.

It's hard to tell in PSX, since it is always SO sharp ;-). That's why I wanted to confirm whether I understood you correctly.

I run PSX mostly on an older computer, and wanted to decrease its hit on hardware, even if by a little bit.

Best regards,

Mariano