Hello, Im trying to get the current directory out of my JFileChooser. I would like to turn this current directory to a string, something like String userdir = fc.getCurrentDirectory(); This obviously doesnt work. Is there anyway to do this?
Printable View
Hello, Im trying to get the current directory out of my JFileChooser. I would like to turn this current directory to a string, something like String userdir = fc.getCurrentDirectory(); This obviously doesnt work. Is there anyway to do this?
Read the API docs.
getCurrentDirectory() returns a File object and the File class has many methods for extracting the file information as a string.