-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
21
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
JFileChooser.setCurrentDirectory fails if setFileSelectionMode(DIRECTORIES_ONLY) is called first
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
final JFileChooser fc = new JFileChooser();
final File file = new File("Some existing directory");
fc.setDialogType(JFileChooser.SAVE_DIALOG);
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
fc.setCurrentDirectory(file); // <= This line produces an index exceptions
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Change the current directory to the specified directory
ACTUAL -
An exception
---------- BEGIN SOURCE ----------
final JFileChooser fc = new JFileChooser();
final File file = new File("Some existing directory");
fc.setDialogType(JFileChooser.SAVE_DIALOG);
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
fc.setCurrentDirectory(file); // <= This line produces an index error
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
// Move setFileSelectionMode after setCurrentDirectory
final JFileChooser fc = new JFileChooser();
final File file = new File("Some existing directory");
fc.setDialogType(JFileChooser.SAVE_DIALOG);
fc.setCurrentDirectory(file);
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
FREQUENCY : often
JFileChooser.setCurrentDirectory fails if setFileSelectionMode(DIRECTORIES_ONLY) is called first
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
final JFileChooser fc = new JFileChooser();
final File file = new File("Some existing directory");
fc.setDialogType(JFileChooser.SAVE_DIALOG);
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
fc.setCurrentDirectory(file); // <= This line produces an index exceptions
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Change the current directory to the specified directory
ACTUAL -
An exception
---------- BEGIN SOURCE ----------
final JFileChooser fc = new JFileChooser();
final File file = new File("Some existing directory");
fc.setDialogType(JFileChooser.SAVE_DIALOG);
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
fc.setCurrentDirectory(file); // <= This line produces an index error
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
// Move setFileSelectionMode after setCurrentDirectory
final JFileChooser fc = new JFileChooser();
final File file = new File("Some existing directory");
fc.setDialogType(JFileChooser.SAVE_DIALOG);
fc.setCurrentDirectory(file);
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
FREQUENCY : often