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

DOC:AWTEvtListener differs from other EvtListeners in AWT w.r.t evt notification

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • Understanding:
      Fix Understood
    • CPU:
      generic
    • OS:
      generic

      Description

      1. When a same instance of an AWTEventListener is added multiple times, the toolkit class internally maintains only a single instance of the listener and 'OR's the new event mask with the existing one. So this will typically result in listener methods being notified only once regardless of how many times we add the same instance.
      But in case of other listeners such as ActionListener, TextListener etc when we add the same instance of the listener multiple times to the same component, all the occurances of the listener would be maintained and will be notified when the event is triggered.

      2. Likewise, When we remove an instance of ActionListener/TextListener etc that was added twice, only the last occurance would be removed and other occurances of the same instance would still be maintained. But this is not the case with
      AWTEventListener where only one occurance is maintained internally and
      that gets removed.

      Since AWTEventListener behavior is much different from other listeners available in AWT, it would be better to document this behavior in the toolkit class for better clarity.

        Attachments

          Activity

            People

            Assignee:
            denis Denis Fokin (Inactive)
            Reporter:
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Imported:
              Indexed: