Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6583251

One more ClassCastException in Swing with TrayIcon

    Details

    • Subcomponent:
    • Resolved In Build:
      b20
    • CPU:
      generic, x86
    • OS:
      generic, windows_xp
    • Verification:
      Not verified

      Backports

        Description

        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

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  alexp Alexander Potochkin (Inactive)
                  Reporter:
                  alexp Alexander Potochkin (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: