How to “correctly” detect DPI of display with Java?

Driver problem.

The real DPI is known only to driver, which reports it to the OS, which reports it to Java and other applications. Since not only Java has the wrong scale, it must be the driver.

This is ages old problem. Many graphical applications have a global setting “screen DPI” where users can adjust for their actual monitor.

Besides, since you’re writing in Java, keep in mind that some OSes have no means of telling Java the real DPI (because they don’t know themselves). The need for DPI configuration setting is thus even more clear.

Leave a Comment