-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
b83
-
x86
-
windows_2000, windows_xp
FULL PRODUCT VERSION :
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows 2000 [Version 5.00.2195]
EXTRA RELEVANT SYSTEM CONFIGURATION :
Also occurs on Windows XP.
A DESCRIPTION OF THE PROBLEM :
When a JPopupMenu containing non-menu item children (eg: JButtons or custom component) extends past the boundaries of a swing applet, clicking on items in the menu closes the popup menu without activating the item.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Load the test applet below.
2. Click on the button in the applet.
3. Attempt to click the button in the popup menu.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"Success" should be printed to the java console as a result of firing the action listener on the button.
ACTUAL -
The popup is closed but the action listener is not triggered.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
------- HTML Source ---------
<html>
<head>
<title>Applet Popup Test</title>
</head>
<body>
<p>The applet below contains a JButton that when clicked shows a JPopupMenu.
On JRE 5, any clicks within the JPopupMenu is not passed through to Java.</p>
<applet codebase="." code="AppletPopup.class" width="20" height="40">
</applet>
</body>
</html>
----------- Applet Source ----------
import javax.swing.*;
import java.awt.event.*;
public class AppletPopup extends JApplet {
static {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
}
public void init() {
super.init();
final JButton btn = new JButton("Popup");
btn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JPopupMenu menu = new JPopupMenu();
JButton item = new JButton("This is a test menu item.");
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.err.println("Success");
}
});
menu.add(item);
menu.show(btn, 0, btn.getHeight());
}
});
getContentPane().add(btn);
}
}
---------- END SOURCE ----------
Release Regression From : 1.4.2_10
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows 2000 [Version 5.00.2195]
EXTRA RELEVANT SYSTEM CONFIGURATION :
Also occurs on Windows XP.
A DESCRIPTION OF THE PROBLEM :
When a JPopupMenu containing non-menu item children (eg: JButtons or custom component) extends past the boundaries of a swing applet, clicking on items in the menu closes the popup menu without activating the item.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Load the test applet below.
2. Click on the button in the applet.
3. Attempt to click the button in the popup menu.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"Success" should be printed to the java console as a result of firing the action listener on the button.
ACTUAL -
The popup is closed but the action listener is not triggered.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
------- HTML Source ---------
<html>
<head>
<title>Applet Popup Test</title>
</head>
<body>
<p>The applet below contains a JButton that when clicked shows a JPopupMenu.
On JRE 5, any clicks within the JPopupMenu is not passed through to Java.</p>
<applet codebase="." code="AppletPopup.class" width="20" height="40">
</applet>
</body>
</html>
----------- Applet Source ----------
import javax.swing.*;
import java.awt.event.*;
public class AppletPopup extends JApplet {
static {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
}
public void init() {
super.init();
final JButton btn = new JButton("Popup");
btn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JPopupMenu menu = new JPopupMenu();
JButton item = new JButton("This is a test menu item.");
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.err.println("Success");
}
});
menu.add(item);
menu.show(btn, 0, btn.getHeight());
}
});
getContentPane().add(btn);
}
}
---------- END SOURCE ----------
Release Regression From : 1.4.2_10
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
- duplicates
-
JDK-6356878 JPopupMenu does not work correctly if JLabel is inside (only in JApplet).
-
- Closed
-
-
JDK-6363030 HeavyWeight JPopupMenu not selectable when focusable
-
- Closed
-