Here you can find the source of PromptForFileOpen(Component c)
public static String PromptForFileOpen(Component c)
//package com.java2s; //License from project: Open Source License import java.awt.Component; import java.io.File; import javax.swing.JFileChooser; public class Main { public static String PromptForFileOpen(Component c) { JFileChooser fc = new JFileChooser(); //ModuleFileTools.DPMSynthFilter filter = new ModuleFileTools.DPMSynthFilter(); fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); fc.setCurrentDirectory(new File(".//Patches//")); //fc.setFileFilter(filter); int returnVal = fc.showOpenDialog(c); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fc.getSelectedFile(); return fc.getCurrentDirectory() + "\\" + file.getName(); } else {/*w w w .j a v a 2 s .c om*/ return null; } } }