How do I reference a panel inside a table? JavaFX2

by_bozkurt

New Member
I'm working with JavaFX2 to implement a WIMP interface by using FXML and CSS to describe the layouts, and then adding the functionality with my Java code.The problem is that I can't seem to reference inside my tab pane, a pane which contains other nodes (nested about 2 deep at deepest I believe).Here is a segment of my FXML:\[code\]<TabPane id="mainTable" layoutX="72.0" layoutY="157.0" prefHeight="349.0" prefWidth="541.0" tabClosingPolicy="UNAVAILABLE"> <tabs> <Tab id="graphicalTab" text="Graphical"> <content> <AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"> <children> <Pane id="paneForCanvas" layoutX="16.0" layoutY="14.0" prefHeight="290.0" prefWidth="510.0" /> </children> </AnchorPane> </content> </Tab>\[/code\]As you can see, I have a pane nested inside called "paneForCanvas", which is very important to my program (it's where an animation section will appear). But when I try\[code\]System.out.println(visualisationRoot.lookup("#paneForCanvas"));//prints null\[/code\]I get returned null, but if I don't try to look at nested nodes, it can find the tab pane "mainTable" just fine.\[code\]System.out.println(visualisationRoot.lookup("#mainTable"));//prints TabPane[id=mainTable, styleClass=tab-pane]\[/code\]I would love to learn why this doesn't work, any help would be great. Ultimately I need to add a canvas to "paneForCanvas", so it's quite necessary I can at least see all nodes.Thanks! :)
 
Back
Top