我们应用程序的用户一直遇到无法正确绘制 Swing GUI 的问题。
所有遇到问题的用户之间的共同联系是他们最近应用了 Windows 更新。用户报告说,对话框在某些显示器上正确绘制,但在其他显示器上绘制不正确。
我们遇到的问题的一个例子*:
用户还报告对话框只显示一个框架,否则是透明的。实际上,如果 UI 线程被阻塞,您会看到同样类型的问题。
可能是什么问题?
*我不能发布我们实际应用程序的屏幕截图,因为它包含敏感信息
最佳答案
更新:此问题已在更新 KB4039884 中修复.
这似乎是由最近的补丁引起的一个相当广泛的问题。它不仅限于 Java:
It seems, that Microsoft’s Update KB4034664 (and KB4034679) for Windows 7 and Windows Server is causing display issues with several applications on a second screen.
由 Born City 报告, Computer World , 和 Microsoft themselves :
If a machine has more than one monitor connected and the screen numbering is not in sequence, some applications will experience rendering issues.
您应该可以通过回滚补丁来解决问题。这是一个安全更新(上面的链接详细说明了包含的内容),因此如果您特别厌恶风险,您可能不想这样做。
Microsoft 将解决方法列为:
- Enable Desktop Composition (needs graphics card support).
- Make sure that the main monitor is on the top left in the monitor layout.
您也可以尝试切换到单一显示器设置,或对您的显示器配置进行其他更改(控制面板 > 显示 > 更改显示设置)。一些报告推测将哪个显示器设置为“主显示器”可能会有所不同。
您可能还想尝试以下标志:-Dsun.noddraw=true
关于java - Windows 7 更新 KB4034664(2017 年 8 月)后多屏幕显示问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45710630/