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

Using ToolTips causes inactive app window to exhibit active window behavior

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 5.0
    • 1.1.6, 1.2.0, 1.4.0, 1.4.1
    • client-libs
    • tiger
    • x86
    • windows_95, windows_2000, windows_xp



      Name: el35337 Date: 06/11/98


      ========== to reproduce ========
      - compile single source file included below
      - run application: java TipTest
      - when app window appears, position another
        application (e.g. Win95 calculator) so that
        it is active, and partially obscures the
        TipTest app window, like this:


         .....................
         | TipTest |
         | .................
         | * |
         | | Calculator
         ................| (or other app)
                         |
                         .................

      - position the mouse (hover over but do
        NOT click) somewhere to the left of the
        calculator app. (approx. in area marked
        by the '*' character above). At this
        point, the calculator app should STILL
        be the active window.

      ====== the bugs ================
      BUG A
        as you rest the mouse cursor over
        the area shown above, the ToolTip will
        appear, even though the TipTest
        window/app is inactive. This
        seems wrong. The TipTest app/window
        should NOT be processing mouse events
        (until the window is made active again).
        For an example of standard Windows behavior,
        look at Netscape Communicator toolbar. When
        another app is active in front of Communicator,
        Communicator's toolbar buttons ignore
        mouse "rollover" events.

      BUG B
        Bug B happens because of Bug A. With the
        mouse cursor resting over the area marked '*',
        wait for the ToolTip to display. Then move the
        mouse slowly down toward the bottom edge of
        the frame, again WITHOUT any mouse clicks.
        When the mouse cursor crosses the frame's
        bottom edge, the TipTest app/window is
        repainted and brought to the FRONT of the
        Calculator app, as though TipTest had been
        made active. However, it is not active, as
        the colors of the two applications title bars
        remain as they were. Also, any keystrokes are
        processed by the calculator program.

      ========== source ==============

      import com.sun.java.swing.*;
      import java.awt.event.*;
      import java.awt.*;
      import java.lang.*;

      public class TipTest extends JPanel
      {
          public TipTest()
          {
              setToolTipText("");
              setBackground(Color.white);
          }

          public static void main(String argv[])
          {
              JFrame f = new JFrame("Tooltip Bug Example");
              TipTest p = new TipTest();

              f.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
              f.getContentPane().add(p);
              f.setSize(new Dimension(350,250));
              f.setVisible(true);
          }

          public String getToolTipText(MouseEvent e)
          {
              return "( x="+e.getX()+",y="+e.getY()+")";
          }

      }
      (Review ID: 33521)
      ======================================================================

            apikalev Andrey Pikalev
            elarsen Erik Larsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: