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

REGRESSION: MouseReleased Event is triggered in JFrame behind a closing JFrame

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_nt, windows_2000

      Description

      Name: jk109818 Date: 05/27/2003


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

      FULL OS VERSION :
      Windows NT Version 4.0

      A DESCRIPTION OF THE PROBLEM :
      When closing a JFrame by double clicking the icon in the upper left corner of the JFrame, a MouseReleased event is triggered on any JFrame behind the closing JFrame. The mouse event should be captured by the closing JFrame.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Open a JFrame
      Open another JFrame, making sure the icon in the left corner of the title bar is inside the first JFrame.
      Double click on the second JFrame's icon in the left corner of the title bar.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The closing frame absorbs all the mouse events from the double click.
      ACTUAL -
      The MouseReleased event from the double click is sent to the JFrame below the closing JFrame.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package com.doesntwork.frametest;

      import java.awt.event.MouseEvent;
      import java.awt.event.MouseListener;

      import javax.swing.JFrame;
      import javax.swing.JPanel;

      public class StartFrame extends JFrame
      {
          public StartFrame()
          {
              init();
          }

          private void init()
          {
              JPanel clickCountPanel = new JPanel();
      clickCountPanel.addMouseListener(new MouseListener()
              {
                  public void mouseClicked(MouseEvent me)
                  {
                      System.out.println("Mouse Clicked");
                  }
                  public void mouseEntered(MouseEvent me)
                  {
                  }
                  public void mouseExited(MouseEvent me)
                  {
                  }
                  public void mousePressed(MouseEvent me)
                  {
                      System.out.println("Mouse Pressed");
                  }
                  public void mouseReleased(MouseEvent me)
                  {
                      System.out.println("Mouse Released " + me.getComponent());
                  }
              });

              this.setContentPane(clickCountPanel);

              this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              this.setSize(200,200);
              this.setVisible(true);

              JFrame smallFrame = new JFrame();
              smallFrame.setSize(100,100);
              smallFrame.setVisible(true);
              smallFrame.setLocation(50,50);
              
          }

          public static void main(String[] args)
          {
              StartFrame frame = new StartFrame();
          }
      }
      ---------- 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: 185968)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dav Andrei Dmitriev (Inactive)
              Reporter:
              jkimsunw Jeffrey Kim (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: