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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • tbd
    • 8u60
    • javafx
    • None

      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)

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

              Created:
              Updated:
              Resolved: