Java tutorial
import java.awt.Component; import javax.swing.JFrame; public class Main { public static void main(String[] argv) throws Exception { JFrame container = new JFrame(); // Get number of children int count = container.getComponentCount(); for (int i = 0; i < count; i++) { Component c = container.getComponent(i); } } }