Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
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
|