-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
5.0
-
generic
-
generic
I am popping up a JFileChooser that shows the current directory of the user. I have already set the selected file programmatically through setSelectedFile(). But when the file chooser is shown, it picks up the first file available in the current directory and hence overrides the selected file set programmatically. This is incorrect. JFileChooser must honor the selected file specified by the user. This affects lot of printing applications which typically pops up the print dialog with the default file name 'out.ps'. The user is unable to set the file name programmatically in printing applications. This happens only when the current directory does not have any folder inside.
I have attached 2 tests one for JFileChooser and one printing app. Make sure you save the tests in a folder that has only files and not folders. Execute the test - FileChooserTest. If you don't see 'out.ps' in the file name textfield, the bug is reproduced. Run the PrintDlg application. If you don't see 'praveen.ps' in the file name text field, the bug is reproduced.
This is reproducible since Tiger-beta2-b38 on all the platforms and not reproducible on any of the previous releases / Tiger-beta1-b32d.
I have attached 2 tests one for JFileChooser and one printing app. Make sure you save the tests in a folder that has only files and not folders. Execute the test - FileChooserTest. If you don't see 'out.ps' in the file name textfield, the bug is reproduced. Run the PrintDlg application. If you don't see 'praveen.ps' in the file name text field, the bug is reproduced.
This is reproducible since Tiger-beta2-b38 on all the platforms and not reproducible on any of the previous releases / Tiger-beta1-b32d.
- duplicates
-
JDK-5031354 REGRESSION: Reg-test javax/swing/JFileChooser/4150029/bug4150029.java fails
- Closed