How to get parent Window in FXML Controller?

后端 未结 1 1625
闹比i
闹比i 2021-02-03 22:58

For example, I want open a DirectoryChooser when clicking on the button:



        
相关标签:
1条回答
  • 2021-02-03 23:39

    you can ask any node for the Scene and then call Scene#getWindow().

    E.g. ((Node)event.getTarget()).getScene().getWindow()

    0 讨论(0)
提交回复
热议问题