United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-5073778 GTK L&F: JFileChooser.getSelectedFile() returns bogus file name
JDK-5073778 : GTK L&F: JFileChooser.getSelectedFile() returns bogus file name

Details
Type:
Bug
Submit Date:
2004-07-14
Status:
Resolved
Updated Date:
2006-11-06
Project Name:
JDK
Resolved Date:
2005-08-17
Component:
client-libs
OS:
windows_xp
Sub-Component:
javax.swing
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

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
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
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mustang


                                     
2004-09-25



Hardware and Software, Engineered to Work Together