对于Java 9应用程序,如何在Windows上禁用缩放UI? [英] How to disable scaling the UI on Windows, for Java 9 applications?

查看:97
本文介绍了对于Java 9应用程序,如何在Windows上禁用缩放UI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Java 8中没有适当的 HiDPI支持.

Java 9 中,JavaFx应用程序可以正确缩放到它们所在的监视器.例如,如果将我的监视器设置为缩放为150%,则Java应用程序将缩放为150%.

请参阅: http://openjdk.java.net/jeps/263

但是,出于测试目的,我需要能够在Windows 10中使用 java.exe标志禁用缩放. >

此外,也许我可以在应用程序本身中以编程方式禁用(并重新启用)此功能?

解决方案

我在http://openjdk.java.net/jeps/263

However, for testing purposes, I need to be able to disable scaling by using java.exe flags, in Windows 10. How can I achieve this?

Also, maybe I can disable (and re-enable) this programmatically within the application itself?

解决方案

I found this obscure option in a substance bug report. This fixes the issue for Swing applications.

-Dsun.java2d.uiScale=1.0

If you're using JavaFX you'll need

-Dprism.allowhidpi=false

Unfortunately I cannot find official documentation for either of these options

这篇关于对于Java 9应用程序,如何在Windows上禁用缩放UI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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