Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4805978

ToolTipManager NullPointerException in 1.4.1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.4.1
    • client-libs



      Name: jk109818 Date: 01/21/2003


      FULL PRODUCT VERSION :
      java version "1.4.1_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
      Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

      FULL OPERATING SYSTEM VERSION : Microsoft Windows 2000
      [Version 5.00.2195]


      A DESCRIPTION OF THE PROBLEM :
      Null pointer exception in ToolTipManager (version 1.4.1).

      In a JPanel I am displaying a complex drawing. As the
      mouse moves over the drawing different elements in the
      drawing may display a tooltip. This is done by overriding
      getToolTipText(MouseEvent e) in the display. getToolTipText
      () returns a String when the mouse is over a tooltip-
      enabled element and null otherwise. The exception below
      occurs when not over a tooltip-enabled element.

      java.lang.NullPointerException

      at javax.swing.ToolTipManager.initiateToolTip
      (ToolTipManager.java:497)

      at javax.swing.ToolTipManager.mouseEntered
      (ToolTipManager.java:458)

      at java.awt.AWTEventMulticaster.mouseEntered
      (AWTEventMulticaster.java:238)

      at java.awt.AWTEventMulticaster.mouseEntered
      (AWTEventMulticaster.java:237)

      at java.awt.Component.processMouseEvent
      (Component.java:5102)

      at java.awt.Component.processEvent
      (Component.java:4890)

      at java.awt.Container.processEvent
      (Container.java:1566)

      at java.awt.Component.dispatchEventImpl
      (Component.java:3598)

      at java.awt.Container.dispatchEventImpl
      (Container.java:1623)

      at java.awt.Component.dispatchEvent
      (Component.java:3439)

      at java.awt.LightweightDispatcher.retargetMouseEvent
      (Container.java:3450)

      at
      java.awt.LightweightDispatcher.trackMouseEnterExit
      (Container.java:3290)

      at java.awt.LightweightDispatcher.processMouseEvent
      (Container.java:3147)

      at java.awt.LightweightDispatcher.dispatchEvent
      (Container.java:3095)

      at java.awt.Container.dispatchEventImpl
      (Container.java:1609)

      at java.awt.Window.dispatchEventImpl
      (Window.java:1585)

      at java.awt.Component.dispatchEvent
      (Component.java:3439)

      at java.awt.EventQueue.dispatchEvent
      (EventQueue.java:450)

      at
      java.awt.EventDispatchThread.pumpOneEventForHierarchy
      (EventDispatchThread.java:197)

      at
      java.awt.EventDispatchThread.pumpEventsForHierarchy
      (EventDispatchThread.java:150)

      at java.awt.EventDispatchThread.pumpEvents
      (EventDispatchThread.java:144)

      at java.awt.EventDispatchThread.pumpEvents
      (EventDispatchThread.java:136)

      at java.awt.EventDispatchThread.run
      (EventDispatchThread.java:99)


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. In a JPanel, draw several lines and a few circles.
      2. Allow circles to have tooltips, for lines no tooltip
      3. Moving mouse around should show this problem.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      No null pointer exceptions from ToolTipManager

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.NullPointerException

      at javax.swing.ToolTipManager.initiateToolTip(ToolTipManager.java:497)

      at javax.swing.ToolTipManager.mouseEntered(ToolTipManager.java:458)

      at java.awt.AWTEventMulticaster.mouseEntered
      (AWTEventMulticaster.java:238)

      at java.awt.AWTEventMulticaster.mouseEntered
      (AWTEventMulticaster.java:237)

      at java.awt.Component.processMouseEvent(Component.java:5102)

      at java.awt.Component.processEvent(Component.java:4890)

      at java.awt.Container.processEvent(Container.java:1566)

      at java.awt.Component.dispatchEventImpl(Component.java:3598)

      at java.awt.Container.dispatchEventImpl(Container.java:1623)

      at java.awt.Component.dispatchEvent(Component.java:3439)

      at java.awt.LightweightDispatcher.retargetMouseEvent
      (Container.java:3450)

      at java.awt.LightweightDispatcher.trackMouseEnterExit
      (Container.java:3290)

      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3147)

      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)

      at java.awt.Container.dispatchEventImpl(Container.java:1609)

      at java.awt.Window.dispatchEventImpl(Window.java:1585)

      at java.awt.Component.dispatchEvent(Component.java:3439)

      at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)

      at java.awt.EventDispatchThread.pumpOneEventForHierarchy
      (EventDispatchThread.java:197)

      at java.awt.EventDispatchThread.pumpEventsForHierarchy
      (EventDispatchThread.java:150)

      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)

      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)

      at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)



      REPRODUCIBILITY :
      This bug can be reproduced often.

      ---------- BEGIN SOURCE ----------
      public String getToolTipText(MouseEvent e) overridden in the display.
      ---------- END SOURCE ----------

      CUSTOMER WORKAROUND :
      Returning the String "" helps, but screen still flashes
      when I move mouse over it.
      (Review ID: 179296)
      ======================================================================

            leifs Leif Samuelsson (Inactive)
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: