code: 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;
  	}
docs: Check for JScrollPane.
  
  @param component
  @return the component itself, or the inner component if it was a
  JScrollPane.