This discussion is archived
4 Replies Latest reply: Nov 8, 2012 10:14 AM by 971758 RSS

TreeView not showing up.

971758 Newbie
Currently Being Moderated
okay so short story. I have this treeview, It is part of an fxml file made in scene builder 1.1. I have the java controller for it too. Everything else shows up just fine when it is compiled and run in Netbeans. But the treeview space is there but empty. It shows up correctly with sample data when previewing in Scenebuilder but not when compiled.

Now I know it should not be empty because I have this code in my controller.

@FXML // fx:id="properties"
private TreeView<String> properties; // Value injected by FXMLLoader


//test code section
final TreeItem<String> root = new TreeItem<String>("Root Node");
root.setExpanded(true);
root.getChildren().addAll(
new TreeItem<String>("Test"),
new TreeItem<String>("Test2"),
new TreeItem<String>("Test3")
);
TreeView<String> properties = new TreeView<String>(root);
//end test code section


and its certainly in the FXML too


<AnchorPane minHeight="580.0" minWidth="5.0" prefHeight="100.0" prefWidth="160.0">
<children>
<AnchorPane minWidth="800.0" prefHeight="529.0" prefWidth="794.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<SplitPane dividerPositions="0.24444444444444444" focusTraversable="true" prefHeight="529.0" prefWidth="794.0" AnchorPane.bottomAnchor="-3.0" AnchorPane.leftAnchor="-1.0" AnchorPane.rightAnchor="1.0" AnchorPane.topAnchor="3.0">
<items>
<AnchorPane maxWidth="-Infinity" minHeight="600.0" minWidth="0.0" prefHeight="593.0" prefWidth="300.0">
<children>
<TreeView fx:id="properties" cache="true" editable="true" minWidth="198.0" prefHeight="750.0" prefWidth="248.0" AnchorPane.bottomAnchor="1.0" AnchorPane.leftAnchor="1.0" AnchorPane.rightAnchor="1.0" AnchorPane.topAnchor="23.0">
<effect>
<Glow level="0.03584905660377358" />
</effect>
</TreeView>



note some things here were previously together on 1 line but could not be pasted in that way since this does not have horizontal scrollbars.

Edited by: Alexander B. Java on Nov 5, 2012 8:22 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points