-
Bug
-
Resolution: Fixed
-
P3
-
6, 7
-
b20
-
generic, x86
-
generic, windows_xp
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2152562 | 6u10 | Alexander Potochkin | P3 | Resolved | Fixed | b05 |
Before JDK 6 all MouseEvents were generated by subclasses of awt.Component
so it was safe to cast mouseEvent.getSource() to awt.Component,
now it's not the case, because TrayIcon can generate MouseEvents
and TrayIcon doesn't extends awt.Component
so we get ClassCastException from several places
like BasicPopupMenu.MouseGrabber.eventDispatched(AWTEvent ev)
where we do Component src = (Component)ev.getSource();
we should fix it and not cast ev.getSource() without checking
so it was safe to cast mouseEvent.getSource() to awt.Component,
now it's not the case, because TrayIcon can generate MouseEvents
and TrayIcon doesn't extends awt.Component
so we get ClassCastException from several places
like BasicPopupMenu.MouseGrabber.eventDispatched(AWTEvent ev)
where we do Component src = (Component)ev.getSource();
we should fix it and not cast ev.getSource() without checking
- backported by
-
JDK-2152562 One more ClassCastException in Swing with TrayIcon
- Resolved
- duplicates
-
JDK-6530871 ClassCastException with JPopupMenu attached to TrayIcon
- Closed
- relates to
-
JDK-6309495 JMenuItem and TrayIcon does not work when in same application
- Resolved
-
JDK-6690791 Even more ClassCasetException with TrayIcon
- Resolved
-
JDK-6285881 JTrayIcon: support Swing JPopupMenus for tray icons
- Closed