United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-5075580 JFileChooser in FILES_AND_DIRECTORIES mode doesn't contain fix for 4239219
JDK-5075580 : JFileChooser in FILES_AND_DIRECTORIES mode doesn't contain fix for 4239219

Details
Type:
Bug
Submit Date:
2004-07-19
Status:
Resolved
Updated Date:
2006-08-02
Project Name:
JDK
Resolved Date:
2006-08-02
Component:
client-libs
OS:
windows_xp
Sub-Component:
javax.swing
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.2,5.0
Fixed Versions:

Related Reports
Backport:
Backport:
Relates:
Relates:

Sub Tasks

Description
Name: jl125535			Date: 07/19/2004


FULL PRODUCT VERSION :
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
When JFileChooser is in FILES_AND_DIRECTORIES mode, it still exhibits the problematic behavior described in bug 4239219, i.e. you must be in the parent directory of directory x to select x.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the attached program on a windows machine. It should open up a file chooser in the My Documents directory.

2. Double-click on My Pictures.

3. Press Open.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Filename: C:\Documents and Settings\user\My Documents\My Pictures
File exists: true

ACTUAL -
Filename: C:\Documents and Settings\user\My Documents\My Pictures\My Pictures
File exists: false
REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.io.*;
import javax.swing.*;

public class FileChooserTest
{
  public static void main(String[] args)
  {
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    fileChooser.showOpenDialog(new JFrame());
    File file = fileChooser.getSelectedFile();
    System.out.println("Filename: " + file.getAbsolutePath());
    System.out.println("File exists: " + file.exists());
    System.exit(0);
  }
}

---------- END SOURCE ----------
(Incident Review ID: 286195) 
======================================================================

                                    

Comments
EVALUATION

Closely related to bug 5073778. Will address for next release.
###@###.### 2004-07-20
                                     
2004-07-20
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mustang


                                     
2004-09-25
EVALUATION

The fix is to set the filename textfield path to the currently selected directory
(in absolute form) when double clicked on FILES_AND_DIRECTORIES mode.
The fix is specific only to filesystem folders otherwise it would return an 
incorrect path for special folders like "My Computer" when clicked from 
Desktop.
                                     
2005-11-14



Hardware and Software, Engineered to Work Together