Hi peoples!!
I’m having a problem with my JFileChooser object…
I’m trying to get the selected file using the getSelectedFile() method…
The problem is this only seems to work when I mouse-click on the file in the directory browser of the file chooser, If I type in the filename into the text input, even if the file is present in the current directory, it doesn’t find the file…
So my question is how do I read the text input aswell so that I can make sure the file can be read no matter how it is retrieved…?
EDIT: please help!!
I’ve checked the java docs to try to find out how to access the text input but i can’t seem to find any function or method that does this…
Otherwise how do I check if the file selected is the same and one currently stored in the directory (if i wanted to prompt the user before overwriting the file for example…)…?