[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: RFR: 7169951: SwingSet2 throws NullPointerException with Nimbus L&F
From:       Abhishek Kumar <abhiscxk () openjdk ! org>
Date:       2023-01-27 17:37:20
Message-ID: xrd1s4Tybbf0GWieRaMruCpyhiUb1rde5XPzaOU_AOQ=.cbc3e477-8791-4498-bc7b-9fb37ff2598c () github ! com
[Download RAW message or body]

On Fri, 13 Jan 2023 04:25:59 GMT, Prasanta Sadhukhan <psadhukhan@openjdk.org> wrote:

> It is observed that if SwingSet2 is run in Nimbus L&F and
> we drag the icon tool bar (which is floatable) out of the GUI Window
> and  Once the tool bar is detached, click on "Look & Feel" menu option to change to \
> any L&F (say Java L&F) it causes NPE due to font being null when getFontMetrics() \
> is called 
> In other L&F, it uses the tabPane's [font \
> ](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java#L2177) \
> whereas in Nimbus font is obtained from getStyle().getFont() which returns null \
> when toolbar is detached from the main window. The proposed fix is to get tabPane's \
> font if the font passed is null alike other L&Fs.  
> No regression test is made as it can be verified with SwingSet2..

Verified SwingSet2 floating toolbar with current fix. 
I think copyright year can be updated else looks good to me.

-------------

Marked as reviewed by abhiscxk (Author).

PR: https://git.openjdk.org/jdk/pull/11984


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic