This is done by calling the appropriate method for adding a Listener. These methods always follow the pattern &quot; addFooListener &quot; , where &quot; Foo &quot; is the Listener Interface Type, without the 'X'. In this example, the addContainerListener method is called to register the XContainerListener:
然后，需要将收听者加入到广播对象中，通过调用相应的方法来加入收听者即可实现此操作。有关方法通常位于“addFooListener”模式后面，其中“Foo”是收听者接口类型 (无“X”)。在此示例中，调用 addContainerListener 方法来注册 XContainerListener：