how to select a folder with FileDialog

Hi guys,

I need to select a folder instead of a file, Ive managed to select a file using this:

if(fileChooser ==null)

{

fileChooser =new JFileChooser();

fileChooser.setDoubleBuffered(true);

}

int returnValue = fileChooser.showOpenDialog(SplitItFrame.this);

if(returnValue == JFileChooser.APPROVE_OPTION)

{

sourceFile = fileChooser.getSelectedFile();

but the dialog shown is set to select a file and I want to select just a folder, from there I'll run several operations like checking if that folder contains a type of file and if that folder has subfolders but right now I need to select a folder instead of a file.

Any clue? :)

[986 byte] By [Purefana] at [2007-10-3 4:34:51]
# 1
setFileSelectionMode(....);
camickra at 2007-7-14 22:38:32 > top of Java-index,Desktop,Core GUI APIs...