aquasw
asked on
JFileChooser double click on file
Hi all
When I`m double clicking on a file shown at the JFileChooser It act like it a directory and perform a drill down to it ( and not choosing it of course)
How could I prevent it and actually choose the file when double clicking on it ?
Thanks
how is it drilling down on a file?
ASKER
It shows in the "Look In:" combo box the name of the file and and when you click on "Select", it can`t finf the file becasue it adding to the current dir the file name as directory
example:
If I open the file chooser in c:\1\ and I choose aa.xml , when double clicking on aa.xml the directory becomes c:\1\aa.xml\ and here it looking for aa.xml.
example:
If I open the file chooser in c:\1\ and I choose aa.xml , when double clicking on aa.xml the directory becomes c:\1\aa.xml\ and here it looking for aa.xml.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
UIManager.put("FileChooser .readOnly" , true);
JFileChooser fc = new JFileChooser(<dir name>);
fc.setFileSelectionMode(JF ileChooser .FILES_ONL Y);
fc.setMultiSelectionEnable d(false);
fc.setFileFilter(new XmlFileFilter());
fc.setDialogTitle("title") ;
JFileChooser fc = new JFileChooser(<dir name>);
fc.setFileSelectionMode(JF
fc.setMultiSelectionEnable
fc.setFileFilter(new XmlFileFilter());
fc.setDialogTitle("title")
ASKER
i solved it by removing the use with setFileSystemView method of FileChooser