You can use (potentially recursively)
the getComponents()
method to find the
component you want to test:
private static void listComponents(Container container) {
Component[] components = container.getComponents();
for (int i = 0; i < components.length; i++) {
System.out.println(components[i]);
if (components[i] instanceof Container) {
listComponents((Container) components[i]);
}
}
}