JavaFX无法加载caspian.css [英] JavaFX can't load caspian.css
问题描述
我有一个Maven项目,我使用 javaxf
WebEngine。我首先通过安装 e(fx)来包含 javafx
剪辑,我能够正常使用它。
I have a Maven project in which I use a javaxf
WebEngine. I first included javafx
by installing e(fx)clipse, and I was able to use it normally.
现在我想将我的程序编译成一个包含所有依赖项的大.jar文件。我首先使用< scope>系统< / scope>
并链接到我的JDK中的 jfxrt.jar
( 1.7.0_45)。我使用 mvm package
编译我的程序,它适用于构建部分。
Now I want to compile my program to a big .jar file with all dependencies included. I first used a <scope>system</scope>
and linked to the jfxrt.jar
in my JDK (1.7.0_45). I compile my program using mvm package
and it works well for the build part.
然后,我安装了 jfxrt.jar
maven感谢这个SO答案所以我有一个 javafx-2.2.45.jar
with maven。
Then, I installed the jfxrt.jar
in maven thanks to this SO answer so I have a javafx-2.2.45.jar
with maven.
然而,当我时,我遇到了这个错误运行我的程序,当涉及到实例化特定的WebEngine时:
However, I'm stuck with this error when I run my program and when it comes to instantiate that particular WebEngine:
INFO: com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged Could not find stylesheet: jar:file:/target/project-name-0.1.one-jar.jar!/lib/javafx-2.2.45.jar!/com/sun/javafx/scene/control/skin/caspian/caspian.css
SEVERE: javafx.scene.control.Control impl_processCSS The -fx-skin property has not been defined in CSS for ScrollBarThemeImpl$ScrollBarWidget@5919e0a8[styleClass=scroll-bar]
java.lang.NullPointerException
at com.sun.webpane.sg.theme.ScrollBarThemeImpl.initializeThickness(ScrollBarThemeImpl.java:341)
at com.sun.webpane.sg.theme.ScrollBarThemeImpl.access$100(ScrollBarThemeImpl.java:27)
at com.sun.webpane.sg.theme.ScrollBarThemeImpl$ScrollBarWidget.impl_updatePG(ScrollBarThemeImpl.java:50)
at javafx.scene.Node.impl_syncPGNode(Node.java:425)
at javafx.scene.Scene$ScenePulseListener.syncAll(Scene.java:2106)
at javafx.scene.Scene$ScenePulseListener.syncAll(Scene.java:2115)
at javafx.scene.Scene$ScenePulseListener.syncAll(Scene.java:2115)
at javafx.scene.Scene$ScenePulseListener.synchronizeSceneNodes(Scene.java:2082)
at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2193)
at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:363)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:463)
at com.sun.javafx.tk.quantum.QuantumToolkit$9.run(QuantumToolkit.java:332)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
我打开了这个jar,并且能够找到它应该是的 caspian.css
文件。
I opened this jar and was able to find the caspian.css
file where it's supposed to be.
如何才能在我的大编译jar中使用我的WebEngine?我不在乎解决方案是否是一个快速,脏的修复程序,例如在其他地方复制/粘贴此css文件(我已经尝试过但我可能已经错过了一些东西......)
What should I do to be able to use my WebEngine in my "big compiled jar"? I don't care if the solution is a quick, dirty fix such as copy/paste of this css file somewhere else (I already tried that but I might have missed something..)
推荐答案
将fx打包到jar中并不是一个好主意。您是否尝试过使用 http:// www。 zenjava.com/2013/07/01/javafx-maven-plugin-2-0-released/
It's not a good idea to package fx into your jar. Have you tried using http://www.zenjava.com/2013/07/01/javafx-maven-plugin-2-0-released/
这篇关于JavaFX无法加载caspian.css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!