Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4730411

EOU: Doc is misleading for JFileChooser.getSelectedFile()/getSelectedFiles()

XMLWordPrintable



      Name: rmT116609 Date: 08/12/2002


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


      A DESCRIPTION OF THE PROBLEM :
      The documentation regarding the getSelectedFile() and getSelectedFiles()methods in JFileChooser does not mention the fact that these methods return null if the selected file is a folder.

      I have the Windows version of j2sdk1.4 and in this case, the methods above must return null when the user selects a folder because if I don't write my code to deal with null files, the program causes a NullPointerException.

      The behavior of the JFile Chooser seems reasonable to me, but I think that the documentation should make this behavior explicit.


      This bug can be reproduced always.
      (Review ID: 144943)
      ======================================================================

            tr Tejesh R
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: