Name: dbT83986 Date: 05/29/99
It appears that as of Swing 1.1, PopupMenuListener.
popupMenuCanceled doesn't get called any more. This was
supposed to be called if the user invoked a popup menu and
then clicked outside the menu area or iconified the application
frame. I looked at the Swing 1.03 source, and there was code
in JPopupMenu.java to do this (in the MouseGrabber code), but
for some reason, the code doesn't exist in Swing 1.1.
I've personally implemented the workaround I specified in the report, so it's not a burning issue for me,
but I do think it's worth fixing to prevent future frustration by others.
I think I can clarify the source code issue I was talking about. In 1.03,
if you look in src/com/sun/java/swing/JPopupMenu.java, there's an inner
class called MouseGrabber (beginning at line 1063 in the code I'm looking
at). MouseGrabber.mousePressed calls MouseGrabber.CancelPopupMenu if the
mouse is clicked outside of the menu. CancelPopupMenu calls
JPopupMenu.firePopupMenuCanceled, which calls popupMenuCanceled on any
listeners.
However, in 1.1, in src/javax/swing/JPopupMenu.java, the MouseGrabber class
no longer exists, and although JPopupMenu.firePopupMenuCancelled still
exists, there is no place in the 1.1 source code where this is ever called.
Hence, popupMenuCanceled never gets called on any listeners.
Let me know if this clarifies the bug sufficiently. If not, I can put
together some sample code to illustrate the problem.
(Review ID: 56920)
======================================================================