SUGGESTED FIX
MenuSelectionManager.processMouseEvent() should be modified.
There is the line:
Component source = (Component)event.getSource();
We must use event.getComponent() instead and check it for null after that.
Udiffs:
src/share/classes/javax/swing/MenuSelectionManager.java
@@ -216,13 +216,13 @@
MenuElement path[];
Vector tmp;
int selectionSize;
p = event.getPoint();
- Component source = (Component)event.getSource();
+ Component source = event.getComponent();
- if (!source.isShowing()) {
+ if ((source != null) && !source.isShowing()) {
// This can happen if a mouseReleased removes the
// containing component -- bug 4146684
return;
}
@@ -234,11 +234,13 @@
&& ((modifiers & (InputEvent.BUTTON1_MASK |
InputEvent.BUTTON2_MASK | InputEvent.BUTTON3_MASK)) !=0 )) {
return;
}
- SwingUtilities.convertPointToScreen(p,source);
+ if (source != null) {
+ SwingUtilities.convertPointToScreen(p, source);
+ }
screenX = p.x;
screenY = p.y;
tmp = (Vector)selection.clone();
|