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

1.4REGRESSION: Tooltip causes window to be raised to foreground (Windows L&F)

XMLWordPrintable

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



      Name: rmT116609 Date: 08/07/2002


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

      and:

      java version "1.4.1-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
      Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)

      FULL OPERATING SYSTEM VERSION :

      Windows NT 5.00

      DESCRIPTION OF THE PROBLEM :
      With J2SE 1.4 and the Windows look-and-feel, tooltips cause Java windows to be raised to the foreground when the tip text is displayed. This causes many problems with Java applications that have overlapping windows, since a mouse
      movement over a tooltip-equipped component will cause a background window to be raised to the foreground.

      Note that I've found that this problem has been newly introduced in J2SE 1.4 and occurs only with the Windows look-and-feel. With the Metal look-and-feel, tooltips do not cause windows to be raised to the foreground.

      REGRESSION. Last worked in version 1.3.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Compile the attached "TooltipTest.java" source file.

      2. Execute this class on Windows 2000 using J2SE 1.4(java TooltipTest).

      3. Two windows will be displayed in the upper-left corner of the screen, labeled W1 and W2. Window W2 will initially be displayed in the foreground, overlapping W1.

      4. Move your mouse pointer over the button on window W1 and wait for the tooltip text to appear.

      5. When the tooltip text appears, note that window W1 has been raised to the foreground.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      The expected behavior is for the tooltip to be displayed, but the window should not be raised to the foreground. In Windows, mouse movement around the screen should not cause windows to be raised to the foreground.

      REPRODUCIBILITY :
      This bug can be reproduced always.

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

      public class TooltipTest
      {
          // Note that problem occurs *only* with the Windows Look-and-Feel.
          // This test class must be executed on a Windows O/S.

          static
          {
              try
              {
                  UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              }
              catch (Exception ex)
              {
                  ex.printStackTrace();
              }
          }
          
          public static void main(String args[])
          {
              JFrame frame1 = new JFrame("W1");
              JButton button = new JButton("Button");
              button.setToolTipText("Tooltip");
              frame1.getContentPane().setLayout(new FlowLayout());
              frame1.getContentPane().add(button);
              frame1.setSize(100, 100);
              frame1.setVisible(true);
              
              JFrame frame2 = new JFrame("W2");
              frame2.setSize(100, 100);
              frame2.setLocation(50, 50);
              frame2.setVisible(true);
          }
      }
      ---------- END SOURCE ----------

      Release Regression From : 1.3.1_04
      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: 158752)
      ======================================================================

            leifs Leif Samuelsson (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: