On Wed, 14 Dec 2022 10:58:47 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> 
wrote:

>> In Swingset2 JInternalFrame demo, focusing on any internalframes and 
>> pressing Ctrl+F7 and then any of up/down/left/arrow key to move the internal 
>> frames results in NPE in NimbusL&F.
>> It is because `JComponent.processKeyBinding() `calls 
>> `SwingUtilities.notifyAction` which calls 
>> `BasicDesktopPaneUI.actionPerformed` where it gets 
>> `Desktop.minOnScreenInsets` property to get the Insets and then uses 
>> insets.top/bottom/left/right value to move the internalframe but this 
>> property is not defined for Nimbus so deferencing Insets object results in 
>> NPE.
>> 
>> Fix is added to create a 0 insets incase some L&F do not define` 
>> Desktop.minOnScreenInsets` property.
>> No regression test is added as it can be easily checked by SwingSet2 
>> JInternalFrame demo.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Test update

test/jdk/javax/swing/JInternalFrame/JInternalFrameTest.java line 118:

> 116:         JDesktopPane desktopPane = new JDesktopPane();
> 117: 
> 118:         iFrame =  new JInternalFrame("Test");

Suggestion:

        iFrame = new JInternalFrame("Test");

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

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

Reply via email to