0
anyone can help me about the code of Filesample.txt in JFile or in JFilechooser?
2 Answers
0
One of the weirdest things about your code was:
if(!file.exists())
// run code that assumes the file exists.
else
// print that the file does not(!) exist.
Your exclamation mark looks like a mistake.
It will be hopeless to get your code to use JFileChooser working in Sololearn's playground because JFileChooser involves a graphical user interface and Sololearn's playground for Java doesn't support GUI. Sololearn's playground also won't give you access to their file system. There is no way to represent the file in their server.
It looks like you should experiment with your code locally with the Java SDK installed on your computer. This way you can show a GUI and see a file chooser dialog appear.
0
uk. thanks for the info