【发布时间】:2012-09-19 10:30:22
【问题描述】:
我正在使用 JavaFX 2.2 编写应用程序。目前我的 Main.fxml 中出现错误。:
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 工作正常。
如果您需要更多我的代码,我会准备在这里为您发布。提前感谢您的回复。
【问题讨论】: