I feel like there should be a simple way to do this but I can\'t figure it out. I have a JFileChooser that allows the user to select directories. I want to show all the file
My solution is a merge between the answers of camickr and trashgod:
final JFileChooser chooser = new JFileChooser() { public void approveSelection() { if (getSelectedFile().isFile()) { return; } else super.approveSelection(); } }; chooser.setFileSelectionMode( JFileChooser.FILES_AND_DIRECTORIES );