|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
public interface ContainerListener
用于接收容器事件的侦听器接口。对处理容器事件感兴趣的类要么实现此接口(以及它包含的所有方法),要么扩展抽象 ContainerAdapter 类(只重写感兴趣的方法)。然后,根据该类创建的侦听器对象使用组件的 addContainerListener 方法向该组件注册。当容器的内容因为添加和移除组件而更改时,可调用侦听器对象中的相关方法,并将 ContainerEvent 传递给它。
这些容器事件“仅”为通知目的而提供;AWT 将自动内部处理添加和移除操作,使程序正常工作,而不管该程序是否注册了一个 ComponentListener。
ContainerAdapter,
ContainerEvent,
Tutorial: Writing a Container Listener| 方法摘要 | |
|---|---|
void |
componentAdded(ContainerEvent e)
已将组件添加到容器中时调用。 |
void |
componentRemoved(ContainerEvent e)
已从容器中移除组件时调用。 |
| 方法详细信息 |
|---|
void componentAdded(ContainerEvent e)
void componentRemoved(ContainerEvent e)
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。