Q:

What is subcomponents in awt and can you retrieve all of them?

In the java docs for java.awt.Component the method getComponentAt describes that it can return a component or a subcomponent.
What is a subcomponent?
Is there a way to retrieve all subcomponents from a component?
Subcomponent mentioned here: http://docs.oracle.com/javase/7/docs/api/java/awt/Component.html

A:

awt uses Container as a special class of Component which can contain other components. So the enumeration of all components is called Container.getComponents(). Why they decided to have the subcomponent access in the Component class instead of the Container class, I don't know, but that's the way it is. Perhaps the reason is that getComponentAt will also return the component for which the method was invoked, if there is no sub-component in that location, and if it actually contains the given position.
So to find all subcompnents, check whether the component is a container. If it is not, then it cannot have subcomponents. If it is, then cast to Container and access them. Recurse if you need sub-sub-components as well.

