简体   繁体   中英

How to use NIO and JFilechooser in Java 7?

I am using Java 7, NIO package rather than IO , but JFileChooser uses File class to getSelectedFile() , but in NIO there is only Path class. How can I use NIO classes with JFileChooser ?

yourPath = yourJFileChooser.getSelectedFile().toPath();
Path path = selectedFile.toPath();

尝试这个 :

File file = Paths.get(URI).toFile();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM