8014264: The applet pathguy_TimeDead throws java.lang.NullPointerException in java console once click drop-down check box

Reviewed-by: art, anthony, serb
This commit is contained in:
Leonid Romanov 2013-06-20 18:50:55 +04:00
parent d792da6ac6
commit 4fb1e1757a
3 changed files with 34 additions and 27 deletions

View File

@ -1,5 +1,5 @@
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
@ -904,11 +904,12 @@ abstract public class XBaseMenuWindow extends XWindow {
*/
public void dispose() {
setDisposed(true);
EventQueue.invokeLater(new Runnable() {
InvocationEvent ev = new InvocationEvent(target, new Runnable() {
public void run() {
doDispose();
}
});
super.postEvent(ev);
}
/**
@ -933,11 +934,12 @@ abstract public class XBaseMenuWindow extends XWindow {
* so events can not be processed using standart means
*/
void postEvent(final AWTEvent event) {
EventQueue.invokeLater(new Runnable() {
public void run() {
handleEvent(event);
}
});
InvocationEvent ev = new InvocationEvent(event.getSource(), new Runnable() {
public void run() {
handleEvent(event);
}
});
super.postEvent(ev);
}
/**

View File

@ -1,5 +1,5 @@
/*
* 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.
*
* 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
//fix 6252982: PIT: Keyboard FocusTraversal not working when choice's drop-down is visible, on XToolkit
if (e instanceof KeyEvent){
// notify XWindow that this event had been already handled and no need to post it again
EventQueue.invokeLater(new Runnable() {
public void run() {
if(target.isFocusable() &&
getParentTopLevel().isFocusableWindow() )
{
handleJavaKeyEvent((KeyEvent)e);
}
InvocationEvent ev = new InvocationEvent(target, new Runnable() {
public void run() {
if(target.isFocusable() &&
getParentTopLevel().isFocusableWindow() )
{
handleJavaKeyEvent((KeyEvent)e);
}
});
}
});
postEvent(ev);
return true;
} else {
if (e instanceof MouseEvent){
@ -1083,11 +1085,13 @@ public class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelS
//convenient method
//do not generate this kind of Events
public boolean handleMouseEventByChoice(final MouseEvent me){
EventQueue.invokeLater(new Runnable() {
public void run() {
handleJavaMouseEvent(me);
}
});
InvocationEvent ev = new InvocationEvent(target, new Runnable() {
public void run() {
handleJavaMouseEvent(me);
}
});
postEvent(ev);
return true;
}

View File

@ -1,5 +1,5 @@
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
@ -1669,11 +1669,12 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
* Do handleJavaMouseEvent on EDT
*/
void handleJavaMouseEventOnEDT(final MouseEvent me){
EventQueue.invokeLater(new Runnable() {
public void run() {
handleJavaMouseEvent(me);
}
});
InvocationEvent ev = new InvocationEvent(target, new Runnable() {
public void run() {
handleJavaMouseEvent(me);
}
});
postEvent(ev);
}
/*