Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 5073778
Votes 2
Synopsis GTK L&F: JFileChooser.getSelectedFile() returns bogus file name
Category java:classes_swing
Reported Against tiger-rc
Release Fixed mustang(b48), 1.4.2_09(b02) (Bug ID:2126363) , 5.0u6(b03) (Bug ID:2127069)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs 5075580
Submit Date 14-JUL-2004
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.



  xxxxx@xxxxx   2004-07-14
Work Around
N/A
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.


  xxxxx@xxxxx   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.
  xxxxx@xxxxx   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).
Posted Date : 2005-07-25 21:26:07.0
Comments
  
  Include a link with my name & email   

Submitted On 25-JUL-2005
sanathusa
I am using JDK 1.4.2_08. If I use FILES_AND_DIRECTORIES option while opening the file chooser, dbl click on a directory and press open, it gives me the selection name as <Drive>\\<Directory>\\<Directory>. DIRECTORIES_ONLY option works fine.
Please advise.



PLEASE NOTE: JDK6 is formerly known as Project Mustang