public interface ContainerListener extends EventListener
ContainerAdapter
类(只覆盖方法的兴趣)。从这个类进行了注册一个组件使用的组件的
addContainerListener
方法创建监听对象。当容器的内容变化,因为组件被添加或删除,在监听对象相关的方法被调用时,与
ContainerEvent
传递给它。
集装箱事件仅提供通知的目的;AWT将自动处理添加和删除操作的内部程序工作正常,无论程序注册一个ContainerListener
或不。
ContainerAdapter
,
ContainerEvent
,
Tutorial: Writing a Container Listener
Modifier and Type | Method and Description |
---|---|
void |
componentAdded(ContainerEvent e)
当一个组件被添加到容器中时调用。
|
void |
componentRemoved(ContainerEvent e)
当组件已从容器中删除时调用。
|
void componentAdded(ContainerEvent e)
void componentRemoved(ContainerEvent e)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.