gpt4 book ai didi

javafx.fxml.LoadException : Invalid property

转载 作者:行者123 更新时间:2023-11-30 10:53:30 27 4
gpt4 key购买 nike

无法弄清楚可能的问题是什么??!!应用程序构建成功并且运行成功,但是当我尝试在 JavaFX Scene Builder 中加载 fxml 文件时,它没有打开并出现以下错误:

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

还有我的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 来修复它。所以可能是我有一些兼容性问题。所以this是下载链接。

关于javafx.fxml.LoadException : Invalid property,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33970132/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com