import javax.swing.JFileChooser;
public class TestJFileChooser
{
public static void main(String[]arg)
{
JFileChooser chooser=new JFileChooser(".");
int result= chooser.showOpenDialog(null);
if(result==JFileChooser.CANCEL_OPTION)
return;
String BD=chooser.getSelectedFile().getAbsolutePath();
System.out.println(BD);
}
}