I am working on a program that loads and saves data from text files, and I am asking the user a file name with JFileChooser on load and save.
This question is about the save dialog: new JFileChooser().showSaveDialog();. The user then could overwrite an existing file without any warning, and that would be a problem.
Any suggestion on how to fix this? I have been looking for some method or option, but I didn’t found anything.
Thanks in advance.
Thanks for the answers, but I found another workaround, overriding the approveSelection() of the JFileChooser, this way:
I hope this could be useful for someone else.