jfilechooser - set directory to a path in a file

后端 未结 6 1201
一整个雨季
一整个雨季 2021-02-19 05:35

I am trying to set the directory path in JFilechooser through something like this(using commons-io ) :

String fileContents = IOUtils.toString(new FileInputStream         


        
6条回答
  •  日久生厌
    2021-02-19 06:29

    if you want to change the directory theb use System.getProperty method

    String s=System.getProperty("user.dir");  // changes directory from documents to the user current Directory;
    

    JFileChooser jfc=new JFileChooser(s);

提交回复
热议问题