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

ToolTips over a heavy-weight window causes the app to lose focus.

    Details

    • Subcomponent:
    • CPU:
      generic, x86, sparc
    • OS:
      generic, solaris_7, windows_nt, windows_2000

      Description

      I have the following containment hierarchy:Frame-->JPanel-->JButtons. The buttons have a tooltip for each of them.
       
      Platform in which occurs: Solaris Sparc; does not occur in Windows.

      % java -version
      java version "1.4.0-internal"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-internal-b57)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b57, mixed mode)

      Steps to reproduce:
      1. Run the following program.
      2. Focus mouse pointer on one of the buttons until the tooltip appears.
      3. Move the mouse clock/anti-clockwise over the buttons, staying in each button very briefly instead of continuously moving.
      4. The app will lose focus after moving 2 buttons this way and will gain & lose focus alternately.

      Code used:
      import java.awt.*;
      import javax.swing.*;

      public class testHeavyPop {
        Frame heavy_pop;
        JPanel panel;
        JButton btn1, btn2, btn3, btn4;
        
        public testHeavyPop() {
          heavy_pop = new Frame("Heavy-weight Popup Test");
          heavy_pop.setSize(300,300);
          
          panel = new JPanel();
          panel.setLayout(new GridLayout(2,2));
          heavy_pop.add(panel);
          
          btn1 = new JButton("Button 1");
          btn1.setToolTipText("I am tooltip over button 1!");
          panel.add(btn1);
          
          btn2 = new JButton("Button 2");
          btn2.setToolTipText("I am tooltip over button 2!");
          panel.add(btn2);
          
          btn3 = new JButton("Button 3");
          btn3.setToolTipText("I am tooltip over button 3!");
          panel.add(btn3);
          
          btn4 = new JButton("Button 4");
          btn4.setToolTipText("I am tooltip over button 4!");
          panel.add(btn4);
          
          heavy_pop.show();
        }
        
        public static void main(String args[]) {
          testHeavyPop t = new testHeavyPop();
        }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dmikhalksunw Denis Mikhalkin (Inactive)
                Reporter:
                sramansunw Sridhar Raman (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: