jfilechooser - set directory to a path in a file

后端 未结 6 1223
一整个雨季
一整个雨季 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:25

    Try to pass the current directory directly in the constructor:

    filechooser = new JFileChooser(theDirectory);
    

提交回复
热议问题