How do I open the JavaFX FileChooser from a controller class?

For any node in your scene (for example, the root node; but any node you have injected with @FXML will do), do

chooser.showOpenDialog(node.getScene().getWindow());

Leave a Comment