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

JFileChooser needs two seconds to switch folder

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.6.0_14"
      Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
      Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      JFileChooser needs two seconds to navigate to a folder.
      Native file choosers need less than a second for the same folder.
      The folder contains just a few items.
      This is inacceptable. People get angry when using Java software on Windows.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      j.setSelectedFile(f); // without this line it is fast
      j.showOpenDialog();


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      may need more time than the native file chooser, but should use less than one second to open
      ACTUAL -
      native file chooser needs less than one second to open (virtually immediately)
      JFileChooser needs more than two seconds

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      see above
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      I assumed that the problem is creating a new instance, but in fact it is not. So caching is no option.

      In fact, the problem is the navigation to the folder as it seems, so there is no real workaround besides NOT using setSelectedFile or switching folder manually (what in fact is absurd).

            rupashka Pavel Porvatov (Inactive)
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: