What value will the controller take ?:
DialogController controller = loader.getController(); When you receive the controller via FXMLLoader you receive an object in which:
initialized fields marked with FXML annotation
when initializing all fields (specified above) the initialize method is called
Call the appropriate methods that handle the relevant events.
The last two points are not so important, since you do not do this manually. The main reason for getting the controller via FXMLLoader is the initialized fields.
Source: https://ru.stackoverflow.com/questions/847706/
All Articles