Windows scaling is messing up the UI on my JavaFX app. Is there any way from within java to let windows know this specific app should not be scaled? Thanks
3 Answers
This should be possible system property -Dprism.allowhidpi=false
. As you asked specifically "within Java" this could be done using the following.
System.setProperty("prism.allowhidpi", "false);
It is important that this is at the very start of your application before JavaFX has initialized, i.e. before Application.launch()

- 35,919
- 9
- 100
- 137
I haven't tried it with JavaFX yet, but that's a recurrent issue which can be influenced by program (exe) properties. Try selecting your editor (Netbeans.exe or Eclipse.exe), selecting properties, and switching to the compatibility tab. On that tab you should see an option labeled "Disable display scaling on high DPI settings".
If you do, select it, run your program, and see if it works. If it does, that just means that after you compile your program for the rest of the world, you ensure that your launcher also has said scaling disabled before distributing. Slick2D, and even Swing, have had similar issues.
It should also be possible to change program properties internally with NIO.2; but I don't know enough of the details off the top of my head.
Let me know if that works.

- 1,729
- 1
- 16
- 25
-
I just had an executable jar, which is a document under windows that opens with javaw.exe. I disabled it like you wrote for javaw.exe, but it has no effect unfortunately. I'm kind of confused about what's the best way to make this into it's own .exe file where the setting would work. If you have any idea I would appreciate. Thanks – Jun 17 '15 at 00:40
-
None yet, but I'll continue looking. – Michael Macha Jun 17 '15 at 06:12
If you re using Windows, I think you should have a look here: Java disable dpi-aware not working . It has worked for many people.