Reputation: 4093
I have an applet for uploading file, and when browse file, it showed all folder normally just like normal except it does not show hidden folder. My question is, is it possible to show hidden folder also in the file browser?
I am using java 1.6 and javax.swing.filechooser
Upvotes: 1
Views: 1048
Reputation: 5735
Hiding files in Swing JFileChooser:
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileHidingEnabled(false);
fileChooser.showOpenDialog(null);
Upvotes: 3
Reputation: 49567
Check setFileHidingEnabled method of JFileChooser.
This method
Sets file hiding on or off. If true, hidden files are not shown in the file chooser. The job of determining which files are shown is done by the FileView.
fileChooser.setFileHidingEnabled(false);
Upvotes: 3
Reputation: 1083
Setting false to the method setFileHidingEnabled() of JFileChooser lets hidden files be shown. see : http://docs.oracle.com/javase/tutorial/uiswing/components/filechooser.html
Upvotes: 3