-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.1.4
-
x86
-
windows_nt
Name: diC59631 Date: 10/07/97
Calling setEnabled for a PopupMenu after the
parent window is shown crashes the virtual
machine.
Sample code:
// --- begin of sample code
import java.awt.*;
import java.awt.event.*;
class bug extends Frame
{
public static void main(String args[]) {
new bug();
}
public bug() {
super("Buggy Popup Menu");
PopupMenu popup = new PopupMenu();
add(popup);
popup.setEnabled(false); // this one is ok
show();
popup.setEnabled(false); // this crashes the VM
}
}
// --- end of sample code
======================================================================
erik.larsen@Eng 1998-05-12
Here's another test case, (web-bug):
a good reason to enable/disable a popup, it
shouldn't crash... I found in in using a generic
MenuItem utility I wrote.
import java.awt.*;
public class test
{
public static void main(String args[])
{
Frame frame = new Frame();
frame.show();
PopupMenu pop = new PopupMenu();
pop.add(new MenuItem("Item 1"));
pop.add(new MenuItem("Item 2"));
frame.add(pop);
pop.setEnabled(false);
}
}