提交 9e1a201c 编写于 作者: L leonidr

8014264: The applet pathguy_TimeDead throws java.lang.NullPointerException in...

8014264: The applet pathguy_TimeDead throws java.lang.NullPointerException in java console once click drop-down check box.
Reviewed-by: art, anthony, serb
上级 53a41cde
/* /*
* Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -904,11 +904,12 @@ abstract public class XBaseMenuWindow extends XWindow { ...@@ -904,11 +904,12 @@ abstract public class XBaseMenuWindow extends XWindow {
*/ */
public void dispose() { public void dispose() {
setDisposed(true); setDisposed(true);
EventQueue.invokeLater(new Runnable() { InvocationEvent ev = new InvocationEvent(target, new Runnable() {
public void run() { public void run() {
doDispose(); doDispose();
} }
}); });
super.postEvent(ev);
} }
/** /**
...@@ -933,11 +934,12 @@ abstract public class XBaseMenuWindow extends XWindow { ...@@ -933,11 +934,12 @@ abstract public class XBaseMenuWindow extends XWindow {
* so events can not be processed using standart means * so events can not be processed using standart means
*/ */
void postEvent(final AWTEvent event) { void postEvent(final AWTEvent event) {
EventQueue.invokeLater(new Runnable() { InvocationEvent ev = new InvocationEvent(event.getSource(), new Runnable() {
public void run() { public void run() {
handleEvent(event); handleEvent(event);
} }
}); });
super.postEvent(ev);
} }
/** /**
......
/* /*
* Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -1033,15 +1033,17 @@ public class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelS ...@@ -1033,15 +1033,17 @@ public class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelS
//fix 6252982: PIT: Keyboard FocusTraversal not working when choice's drop-down is visible, on XToolkit //fix 6252982: PIT: Keyboard FocusTraversal not working when choice's drop-down is visible, on XToolkit
if (e instanceof KeyEvent){ if (e instanceof KeyEvent){
// notify XWindow that this event had been already handled and no need to post it again // notify XWindow that this event had been already handled and no need to post it again
EventQueue.invokeLater(new Runnable() { InvocationEvent ev = new InvocationEvent(target, new Runnable() {
public void run() { public void run() {
if(target.isFocusable() && if(target.isFocusable() &&
getParentTopLevel().isFocusableWindow() ) getParentTopLevel().isFocusableWindow() )
{ {
handleJavaKeyEvent((KeyEvent)e); handleJavaKeyEvent((KeyEvent)e);
}
} }
}); }
});
postEvent(ev);
return true; return true;
} else { } else {
if (e instanceof MouseEvent){ if (e instanceof MouseEvent){
...@@ -1083,11 +1085,13 @@ public class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelS ...@@ -1083,11 +1085,13 @@ public class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelS
//convenient method //convenient method
//do not generate this kind of Events //do not generate this kind of Events
public boolean handleMouseEventByChoice(final MouseEvent me){ public boolean handleMouseEventByChoice(final MouseEvent me){
EventQueue.invokeLater(new Runnable() { InvocationEvent ev = new InvocationEvent(target, new Runnable() {
public void run() { public void run() {
handleJavaMouseEvent(me); handleJavaMouseEvent(me);
} }
}); });
postEvent(ev);
return true; return true;
} }
......
/* /*
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -1669,11 +1669,12 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { ...@@ -1669,11 +1669,12 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
* Do handleJavaMouseEvent on EDT * Do handleJavaMouseEvent on EDT
*/ */
void handleJavaMouseEventOnEDT(final MouseEvent me){ void handleJavaMouseEventOnEDT(final MouseEvent me){
EventQueue.invokeLater(new Runnable() { InvocationEvent ev = new InvocationEvent(target, new Runnable() {
public void run() { public void run() {
handleJavaMouseEvent(me); handleJavaMouseEvent(me);
} }
}); });
postEvent(ev);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册