JDK-6491714 : JFileChooser does not work properly with File selection when filter is changed
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0u9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2006-11-09
  • Updated: 2011-03-09
  • Resolved: 2011-03-08
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 Availability Release.

To download the current JDK release, click here.
Other JDK 6 JDK 7
5.0u12Fixed 6u4Fixed 7 b15Fixed
Related Reports
Relates :  
Description
The original description isn't clear enough to explain the problem. I've contacted the submitter, and we've agreed on the following description:

SETUP REQUIRED:

Go to your home directory and make sure it has the following files:
- "a"
- "b.gif"
- no other GIF files
On Windows XP this is your "My Documents" directory.

NOTE:
Reproducing this bug requires you to stay in the same directory.
Please follow the steps directly and don't change out of the default
directory.

STEPS TO REPRODUCE:

- Launch the JFileChooser demo
- Select "Show JPG and GIF filters"
- Select "Motif"
- Push "Show FileChooser" button
- Ensure that the "*" filter is chosen.
- Select "a" file from the "Files" list on the right
- Toggle filter menu and select "GIF image files (.gif)"
- Try to select "b.gif" file from the "Files" list on the right.
  (It's already selected)
- Though the item in the list is selected, the filename doesn't
apper in "Enter file name:" text field below.
- As a result, double-clicking "b.gif" closes the dialog and does nothing.
  Hitting OK instead, returns file "a".

Original Description
--------------------
When opening a file using JFileChooser with MotifLook&Feel "File does not exist" error is thrown.  This happens when you switch Filter between .x and .y and try to open the highlighted file in the "Files box".

Comments
EVALUATION Motif L&F is very out of date and not very useful any more. As such, there's little benefit to doing anything with this bug. Closing as "Will Not Fix".
14-11-2006

EVALUATION By the way - Ocean and Windows seem to be doing the right thing as of 6.0. That is, they don't clear the text field. But they don't select anything in the list either. Which makes it possible for the user to select something in the list and change the text field. This matches what native XP does. As such, I think the only thing to fix is to have Motif JFileChooser not have anything selected in the list after a filter switch. Leaving the text field with the old value matches Ocean/Windows.
14-11-2006

EVALUATION Heard back from submitter. I've updated the description to properly describe the bug.
14-11-2006

EVALUATION I can't see a bug here. Quoting the submitter: "When opening a file using JFileChooser with MotifLook&Feel "File does not exist" error is thrown." I don't see such an error. Please provide a reproducible test case. Quoting the submitter from the comments: "10.Trying to open that file, will result in an error." I don't see such an error. Please provide a reproducible test case. As far as I can see, JFileChooser is behaving as expected. Need more info from the submitter.
13-11-2006