Java: Pointer le JFileChooser sur le répertoire Courant

Author:

 int,string,char,static, url, socket, url, socket, java
{filelink=23}


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);
 
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *