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

[macos] Focus not painted in JButton when setBorderPainted(false) is invoked

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b11
    • CPU:
      x86, arm
    • OS:
      os_x

      Backports

        Description

        Focus border is not seen on the JButton when setBorderPainted(false) is invoked. This works as expected on other look and feel expect on mac.

        This can be reproduced with SwingSet2 with ButtonDemo by unsetting "Paint Border" checkbox and trying to navigate by pressing tab and + shift tab to move the focus from one button to another button. In order to make sure that focus is moving from one button to another wrote a testcase to add the focus listener to buttons. Please see the attached testcase.

        Step to reproduce:
        1) Run the attached testcase. You will see a checkbox representing "Button Border Paint" and three button to test focus traversal.
        2) Press Tab key so that focus is moves from one button to another. Observe that focus border is seen.
        3) Uncheck "Button Border Painted" checkbox and press tab key to move focus from one button to another. If you see that focus border is not seen but events are printed on the console then the bug is reproduced.

        This works as expected on windows, ubuntu but fails on 11.2.1 Bug Sur arm64 & MacOS Big Sur 11.4 x84_64

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                kizune Alexander Zuev
                Reporter:
                landrews Lawrence Andrews
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: