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

Drag exit of ToolTipManager causes an exception

XMLWordPrintable

    • swing1.0fcs
    • x86
    • windows_nt
    • Verified

      When a swing component has a tool-tip, and user drag it out into the other than its container, you will see the following messages:

      java.lang.NullPointerException:
              at java.awt.swing.ToolTipManager.mouseExited(ToolTipManager.java:222)
              at java.awt.AWTEventMulticaster.mouseExited(AWTEventMulticaster.java:250
      )
              at java.awt.Component.processMouseEvent(Component.java:2501)
              at java.awt.Component.processEvent(Component.java:2338)
              at java.awt.Container.processEvent(Container.java:889)
              at java.awt.Component.dispatchEventImpl(Component.java:1909)
              at java.awt.Container.dispatchEventImpl(Container.java:934)
              at java.awt.Component.dispatchEvent(Component.java:1824)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:1541
      )
              at java.awt.LightweightDispatcher.setMouseTarget(Container.java:1502)
              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:1466)

              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:1382)
              at java.awt.Container.dispatchEventImpl(Container.java:921)
              at java.awt.Window.dispatchEventImpl(Window.java:517)
              at java.awt.Component.dispatchEvent(Component.java:1824)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:160)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:45)

      Here is sample code and steps to re-produce it.
      1) Click and hold a mouse button on the "test" button.
      2) Now move the mouse to the outside of frame.
      3) Release the mouse button.


      import java.awt.*;
      import java.awt.swing.*;

      public class Test extends JFrame
      {
          JButton testButton, dialogButton;
          int xx, yy;

          public Test(){
              super("Test Suite");

              JButton button = new JButton("test");
              button.setToolTipText("hold mouse button and move it to outside frame");

              getContentPane().add(button);
              setSize(200, 100);
              show();
          }

          public static void main(String args[]){
              Test frame = new Test();
          }
      }

            rschiavisunw Richard Schiavi (Inactive)
            bkimsunw Bae-chul Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: