JDK-5073778 : GTK L&F: JFileChooser.getSelectedFile() returns bogus file name
  • Type: Bug
  • Status: Resolved
  • Resolution: Fixed
  • Component: client-libs
  • Sub-Component: javax.swing
  • Priority: P3
  • Affected Version: 5.0
  • OS: windows_xp
  • CPU: x86
  • Submit Date: 2004-07-14
  • Updated Date: 2006-11-06
  • Resolved Date: 2005-08-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
Other JDK 6
1.4.2_09Resolved 6 b48Resolved
Related Reports
Relates :  
Description
Bug Description:
----------------
"Temporary File Location" file chooser is not working as expected,the directory file selected is repeated twice in the File location after selection,this bug is reproducible only in Linux and Solaris.

Jdk-Info:
---------
java version "1.5.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta3-b57)
Java HotSpot(TM) Client VM (build 1.5.0-beta3-b57, mixed mode, sharing)

Steps to Reproduce:
-------------------
1. Install jre1.5.0 b57 in testing Solaris or Linux P.C
2. Invoke JavaControlPanel from command prompt(ControlPanel)
3. Click "Settings" button in General tab
4. "Temporary Files Settings" Window will be displayed
5. Click "Change" button "Temporary File Location" window will be displayed
6. Double click any one folder which is listed in the filechooser

* the folder name will be visible in Selection text field.
7. Click "Select button.
8. The folder selected will be displayed twice in location text field,which is not correct.

for example (/root/temp/temp) but user has selected only the temp folder.

For directory selection if user double clicks the folder name ,the file chooser window has to close and the selected folder name should appear in the Location text box.



###@###.### 2004-07-14

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
2004-09-25

EVALUATION this is a bug in JFileChooser. the attached testcase can be used to reproduce the same problem using a simple java application. on solaris running gnome, with tiger b57: java test this will pop up jfilechooser dialog, in GTK look and feel. select any folder displayed and double click it, you will see the selection displayed, and then hit select button. getSelectedFile() will return incorrect information, for example if the path you double click is /aaa/bbb (meaning you double click on bbb, and current dir is aaa), it will return /aaa/bbb/bbb. single-click on bbb works. now run the same test case with java test useMotif it will pop up JFileCHooser in metal look and feel. run the same testcase, everthing works as expected. it will return /aaa/bbb when double click on bbb, and then hit select button. re-assigning to swing for further evaluation. ###@###.### 2004-07-14 ======================================= This is reproducible with FileChooserDemo in both Motif and GTK L&F. This is not a regression in 1.5 and will be addressed in the next release. ###@###.### 2004-07-15 The fix is to show the current directory path in absolute form just like in Windows and Metal L&F. This would also be consistent with the multiple directory selection mode on the same L&F (GTK and Motif).
2004-09-25