Creates a JavaFX system file chooser. - Java JavaFX

Java examples for JavaFX:DirectoryChooser

Description

Creates a JavaFX system file chooser.

Demo Code


//package com.java2s;

import javafx.stage.DirectoryChooser;
import javafx.stage.Stage;
import java.io.File;

public class Main {
    /**//from   w w w . j a v a 2s .com
     * Creates a system file chooser. Returns chosen file.
     * @return Directory that user chose.
     */
    public static File letUserSelectDir() {
        DirectoryChooser chooser = new DirectoryChooser();
        return chooser.showDialog(new Stage());
    }
}

Related Tutorials