JavaFX整个GUI在某些机器上坏了 [英] JavaFX whole GUI broken on some machines

查看:162
本文介绍了JavaFX整个GUI在某些机器上坏了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[问题]
我在e(fx)clipse中为我的应用程序构建了一个GUI,并将其导出为项目.zip文件和可执行文件.jar-file。我用Java 1.8编译它并在另一台机器上安装了JDK 8并运行了.jar。应用程序启动时没有错误,但整个GUI都被破坏了。所有元素(textareas,按钮等)似乎都是正常尺寸的两倍。
(GUI是通过编码制作的,没有Screen Builder)我不知道这里有什么问题。
如果您需要更多信息,请询问。谢谢!

[PROBLEM] I've build a GUI for my application in e(fx)clipse and exported it as a project .zip-file and executable .jar-file. I compiled it with Java 1.8 and installed the JDK 8 on another machine and ran the .jar. The application starts without error but the whole GUI is broken. All elements (textareas, buttons, etc.) seem to are double their normal size. (GUI was made by coding, no Screen Builder) I have no clue what's the problem here. If you need further information please ask. Thank you!

编辑:似乎有一个更大的问题。我在eclipse中复制粘贴了一个非常简单的JavaFX教程,同样的问题就出现了。所以它似乎不是代码而是JVM?

There seems to be a much bigger problem. I've copy pasted a very simple JavaFX tutorial in eclipse and the same problem occurs. So it seems it's not the code but the JVM?

编辑:按钮(等)的命中框位于正确位置且可点击。只是视觉效果被打破了。设置默认样式表不起作用。

Hit boxes for buttons (etc.) are at the right position and clickable. Just the visuals are broken. Setting default stylesheet didn't work.

编辑:有些机器使用Win7和相同的JRE,它可以工作。我已经在机器上重新安装了JDK / JRE,但它仍然无法正常运行。有人知道如何解决这个问题吗?

There are some machines with Win7 and same JRE and it works. I've reinstalled the JDK/JRE on the machine where it doesn't work but the problem still occurs. Has someone an idea how to fix this?

[解决方案]
正如@tomsontom指出:显卡与JavaFX不兼容。您可以通过 java -jar -Dprism.order = sw your.jar 来解决此问题。相关文章: Windows 7上的JavaFX奇怪渲染

[SOLUTION] As @tomsontom pointed out: The graphics card wasn't compatible to JavaFX. You can fix this by java -jar -Dprism.order=sw your.jar. Relevant post: JavaFX strange rendering on Windows 7

推荐答案

最不可能的原因是,在这台Win7机器上就是:

The most likely reason that it does not work is that on this very Win7 machine is that:


  1. 不支持图形卡,FX正在回退到可能有错误的软件渲染

  2. JavaFX之间的东西/ DirectX和图形卡出错

这篇关于JavaFX整个GUI在某些机器上坏了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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