Is it possible to change the style(or any property) of a JavaFX node if the active controller is not the controller of that node?
For example, say I want to be able to change the color of an AnchorPane by clicking a button. The button and the AnchorPane have two different controllers. How would this be achieved in the simplest way possible?
I have looked into / tried using..
- FXML Nested Controllers http://docs.oracle.com/javafx/2/fxml_get_started/whats_new2.htm
- creating a function in the AnchorPane's controller class that sets the style, and calling to it when button is pressed
When following documentation on Nested Controllers, I came to a stand still after successfully getting an instance of the AnchorPane's root node - couldn't figure out how to actually change the AnchorPane.
When calling to a function in the AnchorPane's controller class that should achieve the desired effect, the AnchorPane reference would always return a null pointer error.