[macosx] Directories are not deselected when JFileChooser has FILES_ONLY selection mode

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: None
    • Component/s: client-libs
    • Environment:

      Mac OS X
      Java(TM) SE Runtime Environment (build 1.6.0_29-b11-397-11M3521)

      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

            Assignee:
            Alexandr Scherbatiy
            Reporter:
            Alexandr Scherbatiy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: