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)
======================================================================