public static < T extends JComponent > Class getJClass ( T component ) { Class < ? > clazz = component . getClass ( ) ; while ( ! clazz . getName ( ) . matches ( "javax.swing.J[^.]*$" ) ) { clazz = clazz . getSuperclass ( ) ; } return clazz ; }
Convenience method to obtain the Swing class from which this component was directly or indirectly derived .