public static Component getSubScreen ( Container container , Class < ? > targetClass ) { for ( int i = container . getComponentCount ( ) - 1 ; i >= 0 ; i -- ) { // Go backwards to do toolbars, menubars last. Component component = container . getComponent ( i ) ; if ( targetClass . isAssignableFrom ( component . getClass ( ) ) ) return component ; if ( component instanceof Container ) { component = JBasePanel . getSubScreen ( ( Container ) component , targetClass ) ; if ( component != null ) return component ; } } return null ; }
Climb down through the panel hierarchy until you find a component of this class .