protected JComponent getInnerComponent ( JComponent component ) { if ( component instanceof JScrollPane ) { return getInnerComponent ( ( JComponent ) ( ( JScrollPane ) component ) . getViewport ( ) . getView ( ) ) ; } if ( component instanceof HasInnerComponent ) { return getInnerComponent ( ( ( HasInnerComponent ) component ) . getInnerComponent ( ) ) ; } return component ; }
Check for JScrollPane .