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

JFileChoose Save Dialog can't save after changing folder with Enter key

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.6.0_18"
      Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
      Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Reproduced in Windows XP, Windows Server 2003, Windows 2000

      A DESCRIPTION OF THE PROBLEM :
      When the focus is on a folder, the Save button changes to Open to allow the user to navigate to the folder. When the focus is not on a folder it should change back to Save to allow the user to save.

      However, if you press Enter to navigate in to a sub-folder which is empty, the Open button does not change to Save, so the user can't save the file.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Open any File Save / Save As dialog using JFileChooser.
      2) Press the Create New Folder icon.
      3) Type the new folder name, press Enter to accept it.
      4) Press Enter again to change to the newly-created folder.
      5) Attempt to press the Save button - it will still be "Open".

      Alternatively:
      1) Open any File Save / Save As dialog using JFileChooser.
      2) Select any folder which you know to be empty, e.g. by single clicking on it.
      3) Press Enter to change to the selected folder.
      4) Attempt to press the Save button - it will still be "Open".



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      After pressing Enter to change to the folder, I would expect the Open button to change back to Save, so the user can now save the file in the folder they have navigated to.

      If instead of pressing Enter the user double clicked to change folder, then this problem does not occur.
      ACTUAL -
      After pressing Enter to change to the folder, there is no Save button, only an Open button.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Any use of JFileChoose for saving.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      No known code fix.

      User operational workarounds:

      Double click to change folder instead of pressing Enter.

      Or, having triggered the problem as described above, click the mouse in either the empty file list or in the filename text entry box, and the button will change back to Save.

            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: