Components not showing in program. Something wrong with my fx:id?
posted 1 year ago
I have made a UI in SceneBuilder where I have an Anchorpane. In the Controller Class I want to add elements to this Anchorpane and have declared an Anchorpane with the same name as the fx:id used in SceneBuilder like this:
I had to add the "= new AnchorPane()" to avoid a Null pointer exception if SearchTabAnchorPane was used in the program. And this leads me to think that maybe this is now not the same object that I made in SceneBuilder. Correct?
And now if I try to add to the Anchorpane during the Controller Class Initialize medhtod (implements Initializable), no components show when I run the program. Here is the code to add the Component.
Have I broken the link between the SceneBuilderAnchorPane and the one I declare in the Controller Class? If so what Im I doing wrong?