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

REGRESSION: setToolTipText does not work if the component is not focussed

    XMLWordPrintable

Details

    • b86
    • generic, x86
    • generic, linux_2.6, windows_xp

    Description

      FULL PRODUCT VERSION :
      1.5.0

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      None

      A DESCRIPTION OF THE PROBLEM :
      The setTooltipText() nolonger works under 1.5, which works fine under 1.4. In order to show the tool tip text under 1.5, the panel where the component reside has to get focused.The following is a simple test program. If you comiple
      and run this under 1.5 (Tiger), you'll see that tool tip text only shows up on the button where the jdialog gets focus. The tool tip text will not show on the button where the jdialog is not focused.

      If you try the program using 1.4, both buttons will show the tool tip text regardless if the jdialog gets focus. This is certainly a bug in the basic GUI
      component in 1.5 and should be fixed easily since it works under 1.4.

      REPRODUCIBLE TESTCASE:
      =====================================================
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.event.*;
      import javax.swing.*;


      public class ToolTipTest extends JFrame
      {
      JDialog jdialog1, jdialog2;

          public ToolTipTest()
      {
      jdialog1=new JDialog();
      jdialog2=new JDialog();
      jdialog1=new JDialog(this, false);
      jdialog1.setLocation(0,0);
      jdialog1.setSize(new Dimension(165, 240));

      jdialog2=new JDialog(this, false);
      jdialog2.setLocation(200,200);
      jdialog2.setSize(new Dimension(165, 240));
      JButton jbtn1=new JButton("Click Me");
      JButton jbtn2=new JButton("Click Me");


              jdialog1.getContentPane().add(jbtn1,BorderLayout.CENTER);
      jdialog2.getContentPane().add(jbtn2,BorderLayout.CENTER);

      jbtn1.setToolTipText("Button1");
      jbtn2.setToolTipText("Button2");

      this.addWindowListener(new WindowAdapter()
      {
                          public void windowClosing(WindowEvent e)
                          {
                              System.exit (0);
                          }
                      }
                  );
      this.pack();
      setVisible(true);
      jdialog1.setVisible(true);
      jdialog2.setVisible(true);

      }
      public static void main(String argv[])
      {
      new ToolTipTest();
      }
      }

      REPRODUCIBILITY :
      This bug can be reproduced always.

      Release Regression From : 1.4.2
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.
      ###@###.### 10/12/04 21:16 GMT

      Attachments

        Issue Links

          Activity

            People

              alexp Alexander Potochkin (Inactive)
              gmanwanisunw Girish Manwani (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: