1
我正在用JavaFX 2.2編寫一個應用程序。目前,我在我的Main.fxml得到一個錯誤:JavaFX:無效的屬性錯誤
Invalid property.
file:/path/to/jar/myProject.jar!/myProject/Main.fxml:13
這裏是Main.fxml的摘錄:
<?import gui.main.elements.*?>
<MainPane fx:id="mainWindow" [...] xmlns:fx="http://javafx.com/fxml" fx:controller="myController">
<children>
<TextField fx:id="search" [...] promptText="Search..." />
<TreeList fx:id="itemViewer" />
<!--why does this not work!?-->
<myTabPane fx:id="tabPane" />
</children>
</MainPane>
TreeList extends TreeView
,MainPane extends AnchorPane
和myTabPane extends TabPane
是自定義類。有趣的是,它運行良好,只是啓用了TreeList,但每當我將TabPane
更改爲myTabPane
時,我都會收到上述錯誤。它指向第13行,即<children>
,這更令人困惑。我猜測myTabPane是MainPane的一個子節點,雖然它對TreeList工作正常,但問題仍然存在。
如果您需要更多我的代碼,我會隨時爲您發佈。提前感謝您的回覆。
呵呵我想問問你是否曾嘗試過,但認爲這太傻了。如果錯誤信息更好,會很好。 –
確實不錯。此外,你不會找到任何有用的,但如果你谷歌的錯誤。 – user1582432
歡迎來到流血的邊緣;) –