I need to know how to get the "browse for folder" dialog in java. I am aware of SWT. But I need to do in swing? Is there any solution to this?
[As we start on eclipse it will ask for choose workspace. We can see the browse for folder dialog at that time] Thanks in advance.
The Windows Forms FolderBrowserDialog component is a modal dialog box that is used for browsing and selecting folders. New folders can also be created from within the FolderBrowserDialog component. To select files, instead of folders, use the OpenFileDialog component.
You can force JFileChooser to select only folders, if you add the following command.
_fileChooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY);
in the snippet that Bibhaw posted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With