-
Bug
-
Resolution: Fixed
-
P4
-
1.2.2, 1.3.0, 1.4.2
-
b46
-
generic, x86
-
generic, windows_nt, windows_2000, windows_xp
java version 1.3.0
Runtime Environment Standard Edition bulid 1.3.0-C, mixed mode
java Hotspot client vm build 1.3.0-c, mixed mode
mouseClicked Event are not delivered when 2 Internal frames are involved and
when we select a component in the internal frame which didn't have the focus..
To Reproduce the problem, Compile and run the following program..Select a node
on Frame 1 and then select a node on Frame 2. You will see the Console Output as
Tree 1 : Mouse Pressed
Tree 1 : Mouse Released
Tree 1 : Mouse Clicked
Tree 2 : Mouse Pressed
Tree 2 : Mouse Released
As u can see although the mousePressed and mouseReleased events were recived
mouseClicked was not received for the Tree2..
import javax.swing.*;
import java.util.*;
import java.awt.event.*;
public class ClickTest extends JFrame implements MouseListener {
JTree tree1;
JTree tree2;
public ClickTest() {
super();
Vector vector1 = new Vector();
vector1.add("Hello1");
vector1.add("Hi1");
Vector vector2 = new Vector();
vector2.add("Hello2");
vector2.add("Hi2");
tree1 = new JTree(vector1);
tree2 = new JTree(vector2);
tree1.addMouseListener(this);
tree2.addMouseListener(this);
JInternalFrame iFrame1 = new JInternalFrame("Frame 1");
JInternalFrame iFrame2 = new JInternalFrame("Frame 2");
JDesktopPane pane = new JDesktopPane();
iFrame1.getContentPane().add(tree1);
iFrame2.getContentPane().add(tree2);
iFrame1.pack();
iFrame2.pack();
iFrame1.setSize(200,200);
iFrame2.setSize(200,200);
pane.add(iFrame1);
pane.add(iFrame2);
iFrame1.show();
iFrame2.show();
getContentPane().add(pane);
pack();
setSize(400,400);
show();
}
public void mousePressed(MouseEvent e) {
if (e.getSource() == tree1) {
System.out.println("Tree 1 : Mouse Pressed");
}
if (e.getSource() == tree2) {
System.out.println("Tree 2 : Mouse Pressed");
}
}
public void mouseReleased(MouseEvent e) {
if (e.getSource() == tree1) {
System.out.println("Tree 1 : Mouse Released");
}
if (e.getSource() == tree2) {
System.out.println("Tree 2 : Mouse Released");
}
}
public void mouseClicked(MouseEvent e) {
if (e.getSource() == tree1) {
System.out.println("Tree 1 : Mouse Clicked");
}
if (e.getSource() == tree2) {
System.out.println("Tree 2 : Mouse Clicked");
}
}
public void mouseEntered(MouseEvent e) {};
public void mouseExited(MouseEvent e) {};
public static void main(String[] args) {
new ClickTest();
}
}
(Review ID: 113817)
======================================================================
- duplicates
-
JDK-4874232 Cannot initiate drag and drop from within an unselected JInternalFrame
- Closed
-
JDK-4921527 When a JList is in a JInternalFrame, a drag gesture is sometimes not recognized
- Closed
-
JDK-4285225 Regression: JInternalFrame not activated on mouse clicks if glassPane replaced
- Closed
- relates to
-
JDK-6309495 JMenuItem and TrayIcon does not work when in same application
- Resolved
-
JDK-6568959 JTable behaves differently in an JFrame directly vs in a JInternalFrame
- Closed
-
JDK-6445802 regreesion test javax/swing/ToolTipManager/4768127/bug4768127.java fails in b90
- Closed