Submitted On 13-OCT-1999
bfinkelman
what i want to know is, how this can be worked around. In the related bug, the
4242595,
the person who submitted it claims that they have a work-around by having an
implementation of
popupMenuWillBecomeInvisible() that checks for a selected MenuItem. I've
tried JMenuItem-->isSelected() and
JPopupMenu>>getSelectionModel()>>isSelected() and neither one ever
returns true. I've also tried adding my popup menu as
an action listener to each menu item and if an item is selected, I set a
private inst var to true, hoping that when popupMenuWillBecomeInvisible()
is invoked, I can tell whether or not something has been selected. This also
doesn't work because the PopupMenuEvent is
triggered before the ActionEvent. If there is no way to work around this bug,
I have a memory leak problem. My project has project-specific
implementations of JPopupMenu, JMenuItem, and JPopupSeparator that aren't
getting garbage collected when the popup
menu is cancelled. Every field in this huge application triggers a popup menu
so this is a potentially large memory leak. Is anyone at Sun even
going to evaluate this bug since it definitely seems like a problem on their
side and not something developers should have to
work around!
Submitted On 20-DEC-1999
AtleWilhelmsen
You could make a workaround by using some sort of timer and listen for all the
popup menu action events.
If no action events has been sent and 1 secound
has elapsed since the popupMenuWillBecomeInvisible event was sent then
is a 99% probability that the popup menu was
canceled.
Submitted On 28-APR-2000
bradmcc
Our application uses multiple java windows with
Jtrees and JTables. When the
user switches between consoles, we are missing not only
popupMenuCanceled notifications, but we are also
missing popupMenuWillBecomeInvisible notifications!
Submitted On 16-NOV-2000
steven.cox
This bug is also present in 1.3.
Submitted On 28-FEB-2001
kwagen
I have tried this workaround and it seems to work (at least with 1.3):
public void popupMenuWillBecomeInvisible(PopupMenuEvent e)
{
EventQueue queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
AWTEvent event = queue.peekEvent();
boolean canceled = false;
if (event == null)
canceled = true;
else
{
if (event instanceof InvocationEvent)
canceled = true;
else if (event instanceof KeyEvent)
{
if (((KeyEvent)event).getKeyChar() == 27)
canceled = true;
}
}
System.out.println("##### Popup menu has been canceled: " + canceled);
}
Submitted On 23-JUN-2001
dbernath
Two years and running on this defect. Is there a year in
which this will be fixed, potentially in a release that
application developers can use (like 1.3.x) or will this
eventually get closed out as fixed in release (insert
codename here).
Submitted On 05-OCT-2001
StrickyShooter
These bug is still 2 years old and sun doesn't fixed it,
what's up? Sun knows the bug why to hell they don't fix it.
Submitted On 30-NOV-2001
lzwcomp
Sun's too busy trying to crank out the next new and
greatest version of the JDK rather than support the code
which is out in the field which developers have to use to
produce real products for real customers.
IS ANYONE AT SUN LISTENING! FIX THE DAMN BUGS IN THE
CURRENT JDK AND DON'T PAWN OFF THE PROBLEM AS FIXED IN SOME
FUTURE RELEASE!
Submitted On 23-APR-2002
DarioDariol
3 years old!
What we are waiting for?
Submitted On 08-DEC-2002
frkane
Three and a half year old (jdk1.4.1_01) and still annoying
everyone! I think, since its claimed as to be fixed noone at
Sun will ever look at this issue again.
Submitted On 06-JUN-2003
inf-collin
It has been fixed in 1.4.2 beta !
yeeeeppeeee !
Submitted On 03-SEP-2003
ronnie9
This bug is not completely fixed as of JDK 1.4.2_01, but it’s
much better than before… at least popupMenuCanceled()
gets called most of the time.
There is still one rather large problem. If the popupMenu us
canceled due to clicking on another JcomboBox then
popupMenuCanceled() does not get called - only the call to
popupMenuWillBecomeInvisible() gets made. I’ve done some
testing, and it only seems to be a problem if you click on a
different JComboBox. Clicking on, say, a JCheckBox will result
in popupMenuCanceled() getting called, as it should be.
Unfortunately, this is still a big problem if popupMenuCanceled
() is not always called when the popupMenu gets cancelled,
so this bug should not be closed until this mechanism works
ALL of the time!
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|