List of usage examples for javax.swing JFrame addContainerListener
public synchronized void addContainerListener(ContainerListener l)
From source file:Main.java
public static void main() { ContainerListener listener = new ContainerAdapter() { public void componentAdded(ContainerEvent evt) { Component c = evt.getChild(); }/*www. j a va2 s. co m*/ public void componentRemoved(ContainerEvent evt) { Component c = evt.getChild(); } }; JFrame frame = new JFrame(); frame.addContainerListener(listener); }