How to prevent editing the directory name in JFileChooser?

To browse directories in JFileChooser, users use a double click. The problem is that if they do not click fast enough, selecting a file believes that they want to edit the directory name, and this is very annoying. Is there a way to disable directory name editing?

+5
source share
1 answer

You can set the file selection to be read-only if necessary:

UIManager.put ("FileChooser.readOnly", Boolean.TRUE);

Unfortunately, this also removes the "new folder" button, if I'm right.

+7
source

All Articles