[OpenJDK 2D-Dev] RFR: 8269951: [macos] Focus not painted in JButton when setBorderPainted(false) is invoked [v3]
kizune at openjdk.java.net
Fri Aug 13 19:26:29 UTC 2021
On Fri, 13 Aug 2021 12:15:38 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
> UIManager.getColor(). should suffice
> But I am not sure with this hardcoded values..Can't we leverage viewRect or textRect to get the required coordinates?
viewRect is set to be exactly (0, 0, b.width, b.height). Insets are buried deep inside JRS classes and used as hardcoded valued, i can not get them from there and both textRect and iconRect are not representing what needs to be drawn to be consistent with the way OS draws focus. Plus they are being initialized only later down the code and at the time of this call they are empty. Not that it would matter.
More information about the 2d-dev