javafx.fxml.LoadException:无效属性
无法找出可能的问题是什么??!!应用程序构建成功并且运行成功,但是当我尝试在JavaFX场景生成器中加载fxml文件时,它没有打开,并出现以下错误:javafx.fxml.LoadException:无效属性,java,javafx,Java,Javafx,无法找出可能的问题是什么??!!应用程序构建成功并且运行成功,但是当我尝试在JavaFX场景生成器中加载fxml文件时,它没有打开,并出现以下错误: com.oracle.javafx.authoring.persist.FXMLDocument$FxmlParseException: Failed to load FXML file at com.oracle.javafx.authoring.persist.FXMLDocument.makeParseException(FXMLDo
com.oracle.javafx.authoring.persist.FXMLDocument$FxmlParseException: Failed to load FXML file
at com.oracle.javafx.authoring.persist.FXMLDocument.makeParseException(FXMLDocument.java:400)
at com.oracle.javafx.authoring.persist.FXMLDocument.load(FXMLDocument.java:311)
at com.oracle.javafx.authoring.persist.FXMLDocument.checkLayout(FXMLDocument.java:239)
at com.oracle.javafx.authoring.persist.FXMLDocument.checkLayout(FXMLDocument.java:224)
at com.oracle.javafx.authoring.Project.forFxml(Project.java:835)
at com.oracle.javafx.authoring.Project.forFxml(Project.java:807)
at com.oracle.javafx.authoring.DesignerTool.loadFXMLLayout(DesignerTool.java:197)
at com.oracle.javafx.authoring.DesignerTool.loadFXMLLayout(DesignerTool.java:185)
at com.oracle.javafx.authoring.DesignerTool.commonInit(DesignerTool.java:513)
at com.oracle.javafx.authoring.DesignerTool.initFromRemote(DesignerTool.java:436)
at com.oracle.javafx.authoring.mbeans.SceneBuilderMgt$1.run(SceneBuilderMgt.java:31)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
at java.lang.Thread.run(Thread.java:724)
Caused by: javafx.fxml.LoadException: Invalid property.
at javafx.fxml.FXMLLoader$PropertyElement.<init>(FXMLLoader.java:1163)
at javafx.fxml.FXMLLoader.createElement(FXMLLoader.java:2372)
at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2345)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2164)
at com.oracle.javafx.authoring.persist.FXMLDocument$2.call(FXMLDocument.java:301)
at com.oracle.javafx.authoring.util.Utils.withFXMLDefaultClassLoader(Utils.java:2216)
at com.oracle.javafx.authoring.persist.FXMLDocument.load(FXMLDocument.java:298)
... 18 mor
com.oracle.javafx.authoring.persist.FXMLDocument$FxmlParseException:未能加载FXML文件
在com.oracle.javafx.authoring.persist.FXMLDocument.makeParseException(FXMLDocument.java:400)上
位于com.oracle.javafx.authoring.persist.FXMLDocument.load(FXMLDocument.java:311)
位于com.oracle.javafx.authoring.persist.FXMLDocument.checkLayout(FXMLDocument.java:239)
位于com.oracle.javafx.authoring.persist.FXMLDocument.checkLayout(FXMLDocument.java:224)
位于com.oracle.javafx.authoring.Project.forFxml(Project.java:835)
位于com.oracle.javafx.authoring.Project.forFxml(Project.java:807)
在com.oracle.javafx.authoring.DesignerTool.loadfxmlayout(DesignerTool.java:197)上
在com.oracle.javafx.authoring.DesignerTool.loadfxmlayout(DesignerTool.java:185)上
位于com.oracle.javafx.authoring.DesignerTool.commonInit(DesignerTool.java:513)
在com.oracle.javafx.authoring.DesignerTool.initFromRemote(DesignerTool.java:436)上
位于com.oracle.javafx.authoring.mbeans.SceneBuilderMgt$1.run(SceneBuilderMgt.java:31)
位于com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
位于com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
位于java.security.AccessController.doPrivileged(本机方法)
位于com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
位于com.sun.glass.ui.invokelateDispatcher$Future.run(invokelateDispatcher.java:76)
在com.sun.glass.ui.win.WinApplication.\u runLoop(本机方法)
com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
位于com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
运行(Thread.java:724)
原因:javafx.fxml.LoadException:无效属性。
在javafx.fxml.fxmloader$PropertyElement。(fxmloader.java:1163)
在javafx.fxml.fxmloader.createElement(fxmloader.java:2372)
在javafx.fxml.fxmloader.processStartElement(fxmloader.java:2345)
在javafx.fxml.fxmloader.load(fxmloader.java:2164)
位于com.oracle.javafx.authoring.persist.FXMLDocument$2.call(FXMLDocument.java:301)
位于com.oracle.javafx.authoring.util.Utils.withFXMLDefaultClassLoader(Utils.java:2216)
位于com.oracle.javafx.authoring.persist.FXMLDocument.load(FXMLDocument.java:298)
... 上午18点
和我的fxml文件:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.paint.*?>
<?import javafx.scene.effect.*?>
<?import javafx.scene.text.*?>
<?import java.net.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<AnchorPane fx:id="root" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="640.0" prefWidth="960.0" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.workspaceit.pos.view.HomeViewController">
<stylesheets>
<URL value="@themes/theme0/style.css" />
</stylesheets>
<children>
<AnchorPane fx:id="loginPane" prefHeight="598.0" prefWidth="440.0" AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<TextField layoutX="40.0" layoutY="278.0" prefHeight="37.0" prefWidth="358.0" text="devadmin" AnchorPane.leftAnchor="40.0" AnchorPane.rightAnchor="40.0" />
<Label layoutX="40.0" layoutY="261.0" text="User name" AnchorPane.leftAnchor="40.0" AnchorPane.rightAnchor="40.0">
<font>
<Font name="System Bold" size="12.0" />
</font></Label>
<Button defaultButton="true" layoutX="40.0" layoutY="399.0" mnemonicParsing="false" onAction="#handleLoginButtonAction" prefHeight="30.0" prefWidth="77.0" text="Login" AnchorPane.leftAnchor="40.0">
<graphic>
<ImageView fitHeight="14.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@themes/theme0/login.png" />
</image>
</ImageView>
</graphic>
</Button>
<Label layoutX="40.0" layoutY="324.0" text="Password" AnchorPane.leftAnchor="40.0" AnchorPane.rightAnchor="40.0">
<font>
<Font name="System Bold" size="12.0" />
</font></Label>
<PasswordField layoutX="40.0" layoutY="340.0" prefHeight="37.0" prefWidth="358.0" text="dev" AnchorPane.leftAnchor="40.0" AnchorPane.rightAnchor="40.0" />
<Hyperlink layoutX="40.0" layoutY="433.0" text="Forgot Password?" AnchorPane.leftAnchor="40.0" />
<ImageView fitHeight="122.0" fitWidth="172.0" layoutX="38.0" layoutY="190.0" preserveRatio="true" AnchorPane.leftAnchor="38.0" AnchorPane.topAnchor="190.0">
<viewport>
<Rectangle2D />
</viewport>
<image>
<Image url="@themes/theme0/logo.png" />
</image>
</ImageView>
</children>
</AnchorPane>
<ImageView fitHeight="122.0" fitWidth="196.0" layoutX="49.0" layoutY="460.0" preserveRatio="true" AnchorPane.bottomAnchor="40.0" AnchorPane.leftAnchor="30.0">
<viewport>
<Rectangle2D />
</viewport>
<image>
<Image url="@themes/theme0/wsit.png" />
</image>
</ImageView>
<Label layoutX="55.0" layoutY="430.0" text="Developed by" AnchorPane.bottomAnchor="65.0" AnchorPane.leftAnchor="30.0">
<font>
<Font name="System Bold" size="10.0" />
</font>
</Label>
<Hyperlink layoutX="66.0" layoutY="545.0" text="workspaceit.com" AnchorPane.bottomAnchor="30.0" AnchorPane.leftAnchor="27.0">
<font>
<Font size="10.0" />
</font>
</Hyperlink>
<MenuBar fx:id="menuBar" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<menus>
<Menu mnemonicParsing="false" text="APP">
<items>
<MenuItem mnemonicParsing="false" text="Reset Password" />
<MenuItem mnemonicParsing="false" text="Close" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="HELP">
<items>
<MenuItem mnemonicParsing="false" text="About" />
<MenuItem mnemonicParsing="false" text="Check for Updates" />
</items>
</Menu>
</menus>
</MenuBar>
</children>
</AnchorPane>
有人能告诉我我做错了什么吗?所以我通过卸载当前版本的JavaFX Scene Builder 1.1和安装的JavaFX Scene Builder 2.0修复了它。所以我可能有一些兼容性问题。
下载链接也是如此。我们可以通过从fxml文件中部分删除节点并重新运行来确定该属性。对我来说很好…@UlukBiy如何做??!!