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

REGRESSION: Tooltip intercepts mouse click when using WindowsLookAndFeel

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.1
    • client-libs



      Name: rmT116609 Date: 10/30/2002


      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] Service Pack 2

      ADDITIONAL OPERATING SYSTEMS :
      Microsoft Windows XP [Version 5.1.2600]


      A DESCRIPTION OF THE PROBLEM :
      If you set the Windows Look And Feel, the tooltips
      associated with JButtons will intercept mouse clicks
      intended for the button. The button does not fire an
      action event and consequently no action occurs.

      Frequently, the tooltip appears just as the user is
      clicking the button and so there is no visual cue that the
      user must move the mouse to not click on the tooltip.

      If you do not set the Windows Look And Feel, it is
      possible to click on a tool tip that is partially
      convering a button and the button still fires.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Launch the test code.
      2. Hover the mouse cursor over the button until the
      tooltip appears.
      3. Click on the button directly (avoid clicking on the
      tooltip) and note the "click" string appears on the
      console output.
      4. Repeat steps 2 and 3 but this time, click on part of
      the tooltip that is in front of the button. Note that
      there is no new console output.
      5. Remove the line that calls UIManager.SetLookAndFeel and
      recompile. Now when you click on part of the tooltip that
      is in front of the button, the button fires.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      The tooltip should not consume the mouse click regardless
      of which LookAndFeel is installed.

      REPRODUCIBILITY :
      This bug can be reproduced often.

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

      public class ToolTipTester extends JFrame {

          public static final void main (String[] args){
           try{
               UIManager.setLookAndFeel
      ("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
              }
              catch (Exception e){
               e.printStackTrace();
              }
              ToolTipTester t = new ToolTipTester();
              t.show();
          }
          
      public ToolTipTester(){
      super();
      setDefaultCloseOperation(DISPOSE_ON_CLOSE);

      JButton testButton = new JButton("Test");
      testButton.addActionListener( new ActionListener(){
      public void actionPerformed(ActionEvent e){
      System.out.println("click");
      }
      });
      testButton.setToolTipText("Test");
      getContentPane().add(testButton);
      pack();
      }
      }

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

      Release Regression From : 1.3.1_06
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      (Review ID: 166427)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: