Hi, Prasanta.
On 07/09/2018 03:57, Prasanta Sadhukhan wrote:
Please review a fix for an issue where obtaining baseline for Button UI in Nimbus L&F results in NPE. Reason for it is when SynthPanelUI#installDefaults is called during frame instantiation, it calls SynthPanelUI#updateStyle which sets the context AND then the style
/private void updateStyle(JPanel c) {//
//        SynthContext context = getContext(c, ENABLED);//
//        style = SynthLookAndFeel.updateStyle(context, this);//
//    }/ > Now, SynthContext.getContext is called with style "null" as style is
updated after calling getContext.
 So, when getBaseline is called and it tries to invoke context.getStyle().getGraphicsUtils() it causes NPE.

Why SynthLookAndFeel.updateStyle() which is called in SynthButtonUI.updateStyle(AbstractButton b) did not update the context which is passed to it? Is it possible that SynthButtonUI.installDefaults() was not called before getBaseline()?


--
Best regards, Sergey.

Reply via email to