public void btnAddDataClicked(ActionEvent actionEvent) { currentUser = (Users)btnAddData.getParent().getScene().getWindow().getUserData(); System.out.println(currentUser); } In this code, using the button object, I get getParent and the object I need in getUserData, I’m wondering how to get it during initialization:@Override public void initialize(URL location, ResourceBundle resources) {
Inside this method, I did not find a suitable object to get getParent.
I tried many things, and all-powerful Google did not help.
PS Thanks in advance for your help!