Reputation: 1571
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 ?
NIO
IO
File
getSelectedFile()
Path
JFileChooser
Upvotes: 2
Views: 1078
Reputation: 168825
Path path = selectedFile.toPath();
Reputation: 31
yourPath = yourJFileChooser.getSelectedFile().toPath();
Upvotes: 3
Reputation: 2616
try this :
File file = Paths.get(URI).toFile();
Upvotes: 0