Getting the Child Components of a Container

This example retrieves all of a container's children in an array:
// Get children Component[] components = container.getComponents(); for (int i=0; i<components.length; i++) { // Get the component's bounds Rectangle bounds = components[i].getBounds(); }
This example retrieves all components individually:
// Get number of children int count = container.getComponentCount(); for (int i=0; i<count; i++) { Component c = container.getComponent(i); }

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.