Bug 16440 - Exceptions thrown when button removes itself
Summary: Exceptions thrown when button removes itself
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: awt (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: pre-0.18
Assignee: Kim Ho
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-08 18:32 UTC by Kim Ho
Modified: 2005-10-16 01:52 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-07-27 00:24:32


Attachments
Test case for bug. (281 bytes, text/plain)
2004-07-08 18:33 UTC, Kim Ho
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kim Ho 2004-07-08 18:32:44 UTC
This was brought up a while back, was fixed but not anymore.

A button that registers an ActionListener that removes the button from its
parent will cause NPE's to be thrown when you click on it. Test case attached.
Comment 1 Kim Ho 2004-07-08 18:33:52 UTC
Created attachment 6713 [details]
Test case for bug.
Comment 2 Thomas Fitzsimmons 2004-07-30 15:34:17 UTC
I'm thinking this is caused by the MOUSE_RELEASED event having nowhere to go. 
Kim, can this be fixed in the same way that you fixed JToolTip, by disabling
mouse events on a component when it is removed?
Comment 3 Kim Ho 2004-07-30 16:56:34 UTC
I just tested it. The MOUSE_RELEASED event does go to the button that was removed.
Comment 4 Kim Ho 2004-07-30 16:58:51 UTC
Oops nevermind. I messed up my test case. Tom is correct. The mouse event just
doesn't get dispatched if the component is no longer in the heirarchy.
Comment 5 Kim Ho 2004-08-03 19:02:24 UTC
fixed in java-gui-branch
Comment 6 Andrew Pinski 2004-12-01 00:36:49 UTC
All of these are all fixed in 4.0.0 by the merge of the gui branch.