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

Tooltip Displaying Over And Over With Custom ToolTipLocation

    XMLWordPrintable

Details

    Description

      FULL PRODUCT VERSION :
      java version "1.5.0_07"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
      Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      When displaying a medium weight tooltip in a custom location, specifically directly under the cursor location, causes the tooltip to redisplay over and over again.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Cause tooltip to display directly under the cursor location
      2. make sure tooltip is medium weight
      3. once tooltip displays wait for timer to hide the tooltip
      4. wait again for initialDelayTimer to display it again
      tooltip will display over and over

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      tooltip should not redisplay after it has been hidden

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import java.awt.event.MouseEvent;
      import javax.swing.*;

      public class HeavyWeightToolTipBug extends JPanel
      {
      public Point getToolTipLocation(MouseEvent event)
      {
      Point p = event.getPoint();
      p.translate(-5, -5);
      return p;
      }

      public static void main(String[] args)
      {
      HeavyWeightToolTipBug panel = new HeavyWeightToolTipBug();
      panel.setToolTipText("A really really long string so that a medium weight popup window will be used for the tooltip instead of a light weight popup window");

      JFrame frame = new JFrame();
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.getContentPane().setLayout(new BorderLayout());
      frame.getContentPane().add(panel);
      frame.setSize(400, 300);
      frame.setVisible(true);
      }
      }

      ---------- END SOURCE ----------

      Attachments

        Activity

          People

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Imported:
              Indexed: