-1

我正在尝试创建一个 JavaFX MDI 应用程序。在 JFXPanel 上使用 FXML 文件,然后在 JInternalFrame 上使用弹出式组件(如菜单和 ComboBox)会出现很多问题

现在我正在尝试使用来自 jfxtras 的 VFXWindow。我采用了其中一个VFXWindow 示例。我对所有样本都感到异常。我如何让它运行?

Exception in Application start method
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:367)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:305)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:894)
    at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:56)
    at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:158)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: com/sun/javafx/scene/control/skin/SkinBase
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at javafx.scene.control.Control.loadClass(Control.java:111)
    at javafx.scene.control.Control.loadSkinClass(Control.java:697)
    at javafx.scene.control.Control$5.invalidated(Control.java:657)
    at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:109)
    at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:143)
    at javafx.css.StyleableStringProperty.set(StyleableStringProperty.java:83)
    at javafx.scene.control.Control$5.set(Control.java:649)
    at javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:69)
    at javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:45)
    at javafx.scene.CssStyleHelper.transitionToState(CssStyleHelper.java:786)
    at javafx.scene.Node.impl_processCSS(Node.java:8889)
    at javafx.scene.Parent.impl_processCSS(Parent.java:1250)
    at javafx.scene.control.Control.impl_processCSS(Control.java:872)
    at javafx.scene.Parent.impl_processCSS(Parent.java:1281)
    at javafx.scene.Node.impl_processCSS(Node.java:8869)
    at javafx.scene.Parent.impl_processCSS(Parent.java:1250)
    at javafx.scene.control.Control.impl_processCSS(Control.java:872)
    at javafx.scene.Parent.impl_processCSS(Parent.java:1281)
    at javafx.scene.Node.processCSS(Node.java:8732)
    at javafx.scene.Scene.doCSSPass(Scene.java:569)
    at javafx.scene.Scene.preferredSize(Scene.java:1576)
    at javafx.scene.Scene.impl_preferredSize(Scene.java:1653)
    at javafx.stage.Window$9.invalidated(Window.java:750)
    at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:109)
    at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:143)
    at javafx.stage.Window.setShowing(Window.java:826)
    at javafx.stage.Window.show(Window.java:841)
    at javafx.stage.Stage.show(Stage.java:250)
    at tutorial.VFXWindowsTutorial1.start(VFXWindowsTutorial1.java:45)
    at com.sun.javafx.application.LauncherImpl$8.run(LauncherImpl.java:837)
    at com.sun.javafx.application.PlatformImpl$7.run(PlatformImpl.java:335)
    at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:301)
    at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:298)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:298)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.access$200(GtkApplication.java:48)
    at com.sun.glass.ui.gtk.GtkApplication$6$1.run(GtkApplication.java:149)
    ... 1 more
Caused by: java.lang.ClassNotFoundException: com.sun.javafx.scene.control.skin.SkinBase
    at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 52 more
Exception running application tutorial.VFXWindowsTutorial1
Java Result: 1
4

1 回答 1

0

您似乎在 Java(FX)8 环境中使用 JFXtras 2.x 版本。Oracle 已经从 JavaFX 2 -> 8 移动了一些类,因此您需要使用 JFXtras 8.x 版本。

也就是说,我不确定开发人员是否将 VFXWindows 迁移到 JavaFX 8,事实上我在当前的源代码树中找不到 VFXWindowsTutorial1 类。然而,有 jfxtras-windows 工件... http://jfxtras.org/

于 2014-12-07T14:01:36.680 回答