United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6491714 JFileChooser does not work properly with File selection when filter is changed
6491714 : JFileChooser does not work properly with File selection when filter is changed

Details
Type:
Bug
Submit Date:
2006-11-09
Status:
Closed
Updated Date:
2011-03-09
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
client-libs
OS:
solaris_9
Sub-Component:
javax.swing
CPU:
sparc
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0u9
Fixed Versions:
7

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

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

Heard back from submitter. I've updated the description to properly describe the bug.
                                     
2006-11-14
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.
                                     
2006-11-14
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".
                                     
2006-11-14
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.
                                     
2006-11-13



Hardware and Software, Engineered to Work Together