Harts
Harts

Reputation: 4093

Java FileSystemView Hidden Folder

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

Answers (3)

Wojciech Owczarczyk
Wojciech Owczarczyk

Reputation: 5735

Hiding files in Swing JFileChooser:

JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileHidingEnabled(false);
fileChooser.showOpenDialog(null);

Upvotes: 3

RanRag
RanRag

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

NotCamelCase
NotCamelCase

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

Related Questions