Since you attached the listener to a JPanel
, you can cast the source of the event
JPanel source = (JPanel) e.getComponent();
Once you have cast it, you can use the Container
class API methods to iterate over the child components (getComponent( int )
, getComponentCount()
, getComponents
)