Java tutorial
import java.io.File; import javax.swing.JFileChooser; public class Main { public static void main(String[] args) { // Display an open file chooser JFileChooser fileChooser = new JFileChooser(); int returnValue = fileChooser.showOpenDialog(null); if (returnValue == JFileChooser.APPROVE_OPTION) { File selectedFile = fileChooser.getSelectedFile(); System.out.println("we selected: " + selectedFile); } } }