-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.1.6
-
x86
-
windows_nt
Name: diC59631 Date: 07/16/98
There seems to be a race condition in the JFilechooser.
When the DIRECTORIES_ONLY option is set,
the JFileChooser seems to randomly filter using
it when first bringing up the dialog. That is, sometimes
only directories are shown in the file list, other times
both directories and files are listed.
I used the following code:
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import com.sun.java.swing.*;
import com.sun.java.swing.preview.*;
import com.sun.java.swing.preview.filechooser.*;
public class FCTest {
Frame f;
public FCTest()
{
f = new Frame();
Button b = new Button();
f.add(b);
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JFileChooser filechooser = new JFileChooser();
filechooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
filechooser.showDialog(new Frame(), "Choose Directory");
}
});
f.setSize(100, 100);
f.setVisible(true);
}
public static void main(String[] args)
{
FCTest t = new FCTest();
}
}
This is running under NT4.0SP3 with JDK 1.1.5 and JDK 1.1.6
with and without the jit.
(Review ID: 35171)
======================================================================
- duplicates
-
JDK-4140059 JFileChooser shows content of multiple directories
-
- Closed
-