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

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Fri Aug 13 12:18:23 UTC 2021

On Fri, 13 Aug 2021 06:18:49 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:
>   Update copyright year

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

> 336: 
> 337:         }
> 338:         Color ringColor = UIManager.getLookAndFeelDefaults().getColor("Focus.color");

I guess we normally call like this in Basic L&F which is extended by different L&Fs so that it will pick up the defaults from the particular L&F in question, otherwise UIManager.getColor(). should suffice as Focus.color is defined in AquaLookAndFeel. 
But I am not sure with this hardcoded values..Can't we leverage viewRect or textRect to get the required coordinates?


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

More information about the 2d-dev mailing list