Details
-
Bug
-
Resolution: Fixed
-
P4
-
None
-
Mac OS X
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-397-11M3521)
-
b63
Description
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-397-11M3521)
Steps to reproduce:
- Run the code below:
----------------------------
import java.io.*;
import javax.swing.*;
public class FileChooserDirTest {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
JFileChooser chooser = new JFileChooser();
chooser.setMultiSelectionEnabled(true);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
int returnVal = chooser.showOpenDialog(null);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File[] files = chooser.getSelectedFiles();
for(File file: files){
System.out.println("Selected file: " + file);
}
}
}
});
}
}
----------------------------
- Select both files and directories
The directories are not deselected
Steps to reproduce:
- Run the code below:
----------------------------
import java.io.*;
import javax.swing.*;
public class FileChooserDirTest {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
JFileChooser chooser = new JFileChooser();
chooser.setMultiSelectionEnabled(true);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
int returnVal = chooser.showOpenDialog(null);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File[] files = chooser.getSelectedFiles();
for(File file: files){
System.out.println("Selected file: " + file);
}
}
}
});
}
}
----------------------------
- Select both files and directories
The directories are not deselected
Attachments
Issue Links
- relates to
-
JDK-8000430 [macosx] Add directories selection support in the java.awt.FileDialog
- Closed