Following NPE can be thrown when close the dragged-out applet quickly with the system close window button. By the time trying to calculate close button position, the frame window has gone.
Way to reproduce,
1. Try following applet, http://rehte.cn.oracle.com:8080/wshost/new_ws/deployment/src/plugin/Decoration/Decoration/html/DecorationTrueJnlp.html
2. Drag out the applet, and close it immediately with the red X close window icon on the frame window.
3. If see the NPE, the bug is reproduced.
4. After the NPE, no AWT events will be dispatched, thus hangs the applet.
Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
at com.sun.deploy.uitoolkit.impl.awt.AWTDragHelper$PerAppletInfo.refreshCloseButtonFrame(AWTDragHelper.java:467)
at com.sun.deploy.uitoolkit.impl.awt.AWTDragHelper$PerAppletInfo.setupCloseListener(AWTDragHelper.java:393)
at com.sun.deploy.uitoolkit.impl.awt.AWTDragHelper$PerAppletInfo.dispatchEventImpl(AWTDragHelper.java:657)
at com.sun.deploy.uitoolkit.impl.awt.AWTDragHelper$PerAppletInfo.dispatchEvent(AWTDragHelper.java:310)
at com.sun.deploy.uitoolkit.impl.awt.AWTDragHelper.dispatchEvent(AWTDragHelper.java:182)
at com.sun.deploy.uitoolkit.impl.awt.AWTDragHelper.access$500(AWTDragHelper.java:55)
at com.sun.deploy.uitoolkit.impl.awt.AWTDragHelper$1$1.eventDispatched(AWTDragHelper.java:161)
at java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Unknown Source)
at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Unknown Source)
at java.awt.Toolkit.notifyAWTEventListeners(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)