Java GUI 缩放问题 [英] Java GUI Scaling problems

查看:33
本文介绍了Java GUI 缩放问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何禁用 Java 程序的缩放 (Windows 10) 或在代码中处理此问题以修复自定义组件上的模糊?

我试过 Dsun.java2d.uiScale.enabled=false 但没有用.

有没有办法解决这个问题?

解决方案

根据您使用的 Java 版本,您可能需要考虑不同的解决方案,尤其是如果您想在应用程序方面解决它.

>

在任何情况下,如果您只想禁用 Windows 10 缩放,您可以通过更改 Java 设置并指定 Windows 兼容性设置来覆盖 DPI 缩放来实现,正如 Elderry 在此处提到的:https://superuser.com/a/1207925 ,正如我引用的:

<块引用>

  1. 找到您安装的 java.exe.
  2. 右键单击 -> 属性
  3. 转到兼容性标签
  4. 检查 覆盖高 DPI 缩放行为.
  5. 缩放执行者选择System:

您可以参考此链接以获取可能解决您问题的其他答案:https://superuser.com/questions/988379/how-do-i-run-java-apps-upscaled-on-a-high-dpi-display

How i can disable scaling (Windows 10) for java program or process this in code to fix blur on my custom components?

I had tried Dsun.java2d.uiScale.enabled=false but it didn’t help.

is there any solution to this problem?

解决方案

Depending on the Java version you are using, you may want to consider different solutions, especially if you'd like to solve it on your application's side.

In any case, and if your concern is just to disable the Windows 10 scaling, you can do so by changing your Java settings and specifying Windows compatibility settings to override DPI scaling, as Elderry mentions here: https://superuser.com/a/1207925 , and as I'm quoting:

  1. Find java.exe you installed.
  2. Right click -> Properties
  3. Go to Compatibility tab
  4. Check Override high DPI scaling behavior.
  5. Choose System for Scaling performed by:

You can refer to this link for additional answers which may resolve your problem: https://superuser.com/questions/988379/how-do-i-run-java-apps-upscaled-on-a-high-dpi-display

这篇关于Java GUI 缩放问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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