When I double click a directory JFileChooser is not opening that directory i.e. it’s not browsing it but it selects the directory and returns.
How can I implement JFileChooser so that it will show the folder’s content when I double click?
If setFileSelectionMode(JFileChooser.FILES_ONLY) is set then the behaviour is good as my needs but I have to use FILES_AND_DIRECTORIES.
When I double click a directory JFileChooser is not opening that directory i.e. it’s
Share
you can add your own
MouseListenerThis checks for double clicks and gets the selected file from the
JFileChooserchecks if that’s a directory and if it is follows it, if it’s a file it returns the file. Also if you select a directory and hit open it opens the directory.