📄 e573. determining when a component is added or removed from a container.txt
字号:
A container fires a container event whenever a component is added or removed.
// Create a listen for container events
ContainerListener listener = new ContainerAdapter() {
public void componentAdded(ContainerEvent evt) {
// Get component that was added
Component c = evt.getChild();
}
public void componentRemoved(ContainerEvent evt) {
// Get component that was removed
Component c = evt.getChild();
}
};
// Register the listener with the container
container.addContainerListener(listener);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -