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

No mnemonics on Open and Save buttons in JFileChooser

    Details

    • Subcomponent:
    • Resolved In Build:
      b68
    • Verification:
      Verified

      Backports

        Description

        Open and Save buttons are default buttons in JFileChooser dialog, therefore mnemonics are redundant.

        Mnemonics in JFileChooser were removed in Metal Look-and-Feel under JDK-7174970.
        Further, mnemonics were removed with the fix for JDK-8042835 from Asian locales (ja, ko, zh_CN, zh_TW) but then they were re-added by JDK-8059177.

        Steps to reproduce:

        1. Run SwingSet2: java -jar SwingSet2.jar
        2. Open JFileChooser demo, the fifth icon.
        3. Click Show Plain JFileChooser button. The should be no mnemonic on Open button in both cases where a file is selected and where a directory is selected.

        The test applies to all Look-and-Feels. In Windows LaF, you need to press and hold Alt button to see mnemonics.

        To change locale, pass -Duser.language possibly with -Duser.country. For example,

        java -Duser.language=es -jar SwingSet2.jar
        java -Duser.language=zh -Duser.country=CN -jar SwingSet2.jar

        Will launch SwingSet2 with Spanish and Chinese (China) UI language correspondingly. SwingSet is not localized but JFileChooser is.


        Alternatively, run the attached FileChooserMnemonics.java to get the list of mnemonic keys in different locales and Look-and-Feels. If there are no mnemonics, you'll see only the list of Look-and-Feels and locales that were tested – it is the expected result. If you see any key, for example "FileChooser.directoryOpenButtonMnemonic = 79" then localization resources need updating.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  aivanov Alexey Ivanov
                  Reporter:
                  shadowbug Shadow Bug
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: