[OpenJDK 2D-Dev] RFR: 8269951: [macos] Focus not painted in JButton when setBorderPainted(false) is invoked [v4]

Sergey Bylokhov serb at openjdk.java.net
Mon Aug 16 18:52:27 UTC 2021

On Fri, 13 Aug 2021 19:17:13 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

>> Initial implementation and a test case.
>> The problem is that Aqua LaF shows the focused component with the glow on the border, hence when the border is not painted the foxus is not displayed. The idea is to paint the glowing border on the focused component anyways.
> Alexander Zuev has updated the pull request incrementally with one additional commit since the last revision:
>   Remove getLookAndFeelDefaults() call

That looks great.

src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java line 340:

> 338:         Color ringColor = UIManager.getColor("Focus.color");
> 339:         g.setColor(ringColor);
> 340:         g.drawRoundRect(5, 3, b.getWidth() - 10, b.getHeight() - 7, 15, 15);

Don't you need to restore the properties of Graphics2D?


PR: https://git.openjdk.java.net/jdk/pull/5082

More information about the 2d-dev mailing list