import java.awt.Component;
import java.awt.event.ContainerAdapter;
import java.awt.event.ContainerEvent;
import java.awt.event.ContainerListener;
import javax.swing.JFrame;
public class Main {
public static void main() {
ContainerListener listener = new ContainerAdapter() {
public void componentAdded(ContainerEvent evt) {
Component c = evt.getChild();
}
public void componentRemoved(ContainerEvent evt) {
Component c = evt.getChild();
}
};
JFrame frame = new JFrame();
frame.addContainerListener(listener);
}
}