1 Reply Latest reply: Nov 6, 2012 2:57 AM by Darryl Burke RSS

    JDK6 SwingUtilities NullPointerException when user try to open Popup Window

    894060
      When user clicks first time, the popup menu displayed without any error. User clicks again approx. 4-6 times to open the same popup screen and the popup menu will be displayed with the NullPointerException error. After NullPointerException user is not able to clikc on any button. Swing GUI is hanging & not recognizing the event selected by user in GUI Window and failing with the error NullPointerException.

      JVM Version (Tested with the Latest JDK version):-
      jdk1.6.0_35
      jdk1.6.0_37

      Code:-
      ( (JPopupMenu)popupMenuView ).show( JTree, location.x, location.y );

      Error:-
      java.lang.NullPointerException
      at javax.swing.SwingUtilities.getWindowAncestor(SwingUtilities.java:120)
      at javax.swing.Popup.dispose(Popup.java:113)
      at javax.swing.Popup.hide(Popup.java:105)
      at javax.swing.ToolTipManager.hideTipWindow(ToolTipManager.java:322)
      at javax.swing.ToolTipManager.mouseExited(ToolTipManager.java:555)
      at java.awt.AWTEventMulticaster.mouseExited(AWTEventMulticaster.java:293)
      at java.awt.AWTEventMulticaster.mouseExited(AWTEventMulticaster.java:292)
      at java.awt.Component.processMouseEvent(Component.java:6303)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3275)
      at java.awt.Component.processEvent(Component.java:6062)
      at java.awt.Container.processEvent(Container.java:2039)
      at java.awt.Component.dispatchEventImpl(Component.java:4660)
      at java.awt.Container.dispatchEventImpl(Container.java:2097)
      at java.awt.Component.dispatchEvent(Component.java:4488)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575)
      at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:4356)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4218)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166)
      at java.awt.Container.dispatchEventImpl(Container.java:2083)
      at java.awt.Window.dispatchEventImpl(Window.java:2489)
      at java.awt.Component.dispatchEvent(Component.java:4488)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:668)
      at java.awt.EventQueue.access$400(EventQueue.java:81)
      at java.awt.EventQueue$2.run(EventQueue.java:627)
      at java.awt.EventQueue$2.run(EventQueue.java:625)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
      at java.awt.EventQueue$3.run(EventQueue.java:641)
      at java.awt.EventQueue$3.run(EventQueue.java:639)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:638)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)