Reputation: 11
How can the relationship between a .fxml
file and its corresponding Controller Class be explained
Upvotes: 0
Views: 85
Reputation: 4223
To put it simply, the .fxml file defines what all UI elements are required and how their heirarchy should be built. It also defines the actions to be performed when some user event occurs on these UI elements.
During runtime, the UI components generated by JavaFX are injected as instance variables in the controller. And callbacks from the UI elements are routed to methods in the controller.
Refer:
Upvotes: 1