-
Bug
-
Resolution: Won't Fix
-
P3
-
6
-
x86
-
windows_nt, windows_2000
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)
======================================================================
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)
======================================================================
- relates to
-
JDK-4531852 MOUSE_RELEASED sent when FileDialog dismissed by double-clicking
- Open
-
JDK-6323058 MouseReleased event consumed on toplevel if press occur on other
- Resolved
-
JDK-4664415 REGRESSION: double click jframe titlebar generating mouse events in panel
- Resolved
-
JDK-4955581 [Win] Caret is positioned incorrectly while using Chinese QuanPin Input Method
- Closed