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

[Buttton] Provide a switch for Enter-Fires-Focused-Button instead of Enter-Fires-Default-Button

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 8u60
    • Fix Version/s: tbd
    • Component/s: javafx
    • Labels:
      None

      Description

      In JDK-8092918 there has been a discussion about the following issue:

      Windows users are used to the behaviour that allways the focused Button is fired when pressing the enter key.
      But since 8u20 the default behaviour in JavaFX is to allways fire the default Button even if an other is focused.

      For Windows users which are familiar with the first described behaviour it could lead to really problematic situations:
      There is a confirmation Alert for lets say "Delete Item?", Windows users (including me) will move the focus to the cancel Button and press Enter. But the Alert returns "Optional[ButtonType [text=OK, buttonData=OK_DONE]]"...

      All of our customers use Windows, so for us (and I'm sure there are many developers who have the same target platform) it is really important to have a Windows behaviour in our application.
      We have written a really big helper class which handles all circumstances (dynamic button addition etc.) to readjust the Windows behaviour.

      I would prefer a solution within JavaFX. For example:
      Button.setDefaultButtonFollowsFocus(boolean)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jgiles Jonathan Giles
                Reporter:
                aliebelt Andreas Liebelt
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: