Example usage for javafx.scene.control Button getParent

List of usage examples for javafx.scene.control Button getParent

Introduction

In this page you can find the example usage for javafx.scene.control Button getParent.

Prototype

public final Parent getParent() 

Source Link

Usage

From source file:com.bekwam.mavenpomupdater.MainViewController.java

@FXML
public void selectFile(ActionEvent evt) {

    if (log.isDebugEnabled()) {
        log.debug("[SELECT FILE]");
    }/*from ww  w. j ava 2 s .c  o  m*/

    Button b = (Button) evt.getSource();

    Window w = b.getParent().getScene().getWindow();

    DirectoryChooser dirChooser = new DirectoryChooser();

    File dir = dirChooser.showDialog(w);
    if (dir != null) {
        tfRootDir.setText(dir.getAbsolutePath());
    }
}