Java:是否可以从Java内部禁用Windows DPI缩放? [英] Java: Is it possible to disable Windows DPI scaling from within java?

查看:43
本文介绍了Java:是否可以从Java内部禁用Windows DPI缩放?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows缩放使我的JavaFX应用程序上的UI混乱.从Java内部有什么方法可以让Windows知道不应该缩放此特定应用程序?谢谢

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

推荐答案

这应该是系统属性 -Dprism.allowhidpi = false .正如您在在Java内"专门询问的那样,可以使用以下命令完成此操作.

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);

重要的是,这是在JavaFX初始化之前(即Application.launch()之前)在应用程序的开始阶段

It is important that this is at the very start of your application before JavaFX has initialized, i.e. before Application.launch()

这篇关于Java:是否可以从Java内部禁用Windows DPI缩放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆