FULL PRODUCT VERSION :
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Popup menus sometimes display empty space at the buttom. The height of the menu rectangle is more than it has to be.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) Run two instances of the program below
2) Right mouse click on the first frame to display a menu
3) Right mouse click on the other frame to display a menu
4) Repeat steps 2 and 3 till you see empty space at the buttom of the menu rectangle.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Did not expect you break popup menus
ACTUAL -
Witnessed you break popup menus
REPRODUCIBILITY :
This bug can be reproduced occasionally.
---------- BEGIN SOURCE ----------
public static void main(String s[])
{
// set windows look and feel
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (Exception exc)
{
}
// Workaround to always display mnemonics. XP does not diplay them until Alt is pressed.
UIManager.put("Button.showMnemonics", Boolean.TRUE);
final JFrame frame = new JFrame("Test");
frame.setBounds(100, 100, 300, 300);
frame.setVisible(true);
final JPopupMenu popup = new JPopupMenu();
popup.add(new JMenuItem("test 1"));
popup.addSeparator();
JCheckBoxMenuItem mi2 = new JCheckBoxMenuItem("test 2");
mi2.setSelected(true);
popup.add(mi2);
popup.addSeparator();
JMenuItem mi3 = new JMenuItem("test 3");
mi3.setMnemonic('3');
mi3.setEnabled(false);
popup.add(mi3);
popup.addSeparator();
popup.add(new JCheckBoxMenuItem("test 4"));
popup.addSeparator();
popup.add(new JMenuItem("test 5"));
popup.addSeparator();
popup.add(new JMenuItem("test 6"));
popup.addSeparator();
popup.add(new JMenuItem("test 7"));
frame.addMouseListener(new MouseAdapter()
{
public void mouseReleased(MouseEvent e)
{
if (e.isMetaDown())
{
// display popup menu
popup.show(frame, e.getPoint().x, e.getPoint().y);
}
}
});
}
---------- END SOURCE ----------
Release Regression From : 1.4.2
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
###@###.### 10/18/04 23:13 GMT