srisar srisar - 4 months ago 23
Java Question

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
?

Answer
Path path = selectedFile.toPath();