user1582432
user1582432

Reputation: 745

JavaFX: Invalid Property error

I'm writing an application with JavaFX 2.2. Currently I am getting an error in my Main.fxml.:

Invalid property.
file:/path/to/jar/myProject.jar!/myProject/Main.fxml:13

Here is an excerpt of the 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 and myTabPane extends TabPane are custom classes. The funny thing is that, it runs fine with just TreeList enabled but whenever I change TabPane to myTabPane I get the above error. It points to line 13, i.e. <children>, which is even more confusing. I'm guessing that there is a problem with myTabPane being a child of MainPane, although it works fine for TreeList.

If you need any more of my code I'll be ready to post it here for you. Thanks in advance for your replies.

Upvotes: 1

Views: 1655

Answers (1)

user1582432
user1582432

Reputation: 745

Found the error. And its stupider than I thought. Each element in the Main.fxml should start with an upper case letter!! (as java conventions recommend) so I changed myTabPane to TabManager and now it works!

Upvotes: 1

Related Questions