javafx scene.lookup


Question

I am converting an existing swing app to JavaFX. I would think that this code would return a node called "#paneRightBottom", but it returns null. Using the netbeans debugger I am able to drill down on the "topNode" and find the "#paneRightBottom" node six levels deep, so it is there. I have read the online docs and think that I should be getting a node. Does anyone have an idea of where I've gone wrong?

        Node topNode = FXMLLoader.load(AFI.class.getResource("afimain.fxml"));
        System.out.println(topNode.getId());
        Node node = topNode.lookup("#paneRightBottom");
1
1
12/28/2012 7:00:53 PM

Check if the node, which you are trying to lookup, has an id="paneRightBottom" and not fx:id="paneRightBottom". If it has then give more details by posting your fxml file too.

3
12/28/2012 8:49:52 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon