[OpenJDK 2D-Dev] RFR: 8269951: [macos] Focus not painted in JButton when setBorderPainted(false) is invoked
kizune at openjdk.java.net
Thu Aug 12 11:09:26 UTC 2021
On Thu, 12 Aug 2021 02:15:06 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
> Painting the border while the user tries to disable the border via setBorderPainted(false) does not look like a correct solution. The user might be drawn something there already. I remember we discussed a similar a11y bug related to focus and the only possible solution was to draw the focus ourselves or request this feature in the JRS.
There is no other way on Mac OS to indicate focused button but the glowing border. The same situation happens on Motif L&F - the only way to differentiate focused button from unfocused is by the border and in Motif - just as in Aqua - once border painting is disabled there is no way to tell if button is focused or not. User might draw something but if button becomes focused the focus indication will be drawn over it. If focus indicator disrupts user's painting on top of the button insets area user can always disable focus painting on such a component deliberately by calling JButton.setFocusPainted(boolean)
More information about the 2d-dev