Search code examples
controlsjavafx-2stage

How to retrieve stage from UI control in JavaFX


The question is pretty simple, but I haven't found any examples relating to this. I want to obtain the containing Stage of a UI Control in JavaFX. Is there a way to do this?


Solution

  • ((Stage) Control.getScene().getWindow())