Getting full file path for Jfilechooser
Hi im new at programming with Java and I have found examples to get the directory with a file Dialog.
it got really easy method to obtain it, but the thing is tha I want to do it with a Jfilechooser but cannot find the method.
I磀 tryed getting it by making a file but when compiling it gave me a error.
do I have to import a class for creating file? cus it aint recognising the creation of file.
I leave code and bugging.
if (returnVal == JFileChooser.APPROVE_OPTION) {
String nombre = fc.getName();
File f = fc.getSelectedFile();
String path = f.getAbsolutePath();
archivo= path + nombre;
}
}
Z:\RealApplet\Realoader\Realoader.java:89: cannot find symbol
symbol : class File
location: class Realoader
File f = fc.getSelectedFile();
^
1 error
Process completed.

