Hi ,
On browse button I am using following code to select files of type .xls
public JFileChooser _fileChooser = new JFileChooser();
private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {
FileFilter filter1 = new ExtensionFileFilter("xls", new
String[] { "XLS" });
_fileChooser.setFileFilter(filter1);
int retval = _fileChooser.showDialog(this,"Select");
if (retval == JFileChooser.APPROVE_OPTION) {
//... The user selected a file, get it, use it.
File file = _fileChooser.getSelectedFile();
path = file.getAbsolutePath();
metadataPath.setText(path);
}
}
but, using this I am able to select only files...
Now I want a code that will be
able to select only directories and not files .. Like the functionality of choosing path to store file ... i.e to give destination to store files ... and not to select files ..
Could anyone please give sample code for this ??