private TableCellRenderer getCellRenderer ( Class < ? > type ) { // try to create one from the factory TableCellRenderer renderer = getRendererFactory ( ) . createTableCellRenderer ( type ) ; // if that fails, recursively try again with the superclass if ( renderer == null && type != null ) { renderer = getCellRenderer ( type . getSuperclass ( ) ) ; } // if that fails, just use the default Object renderer if ( renderer == null ) { renderer = super . getDefaultRenderer ( Object . class ) ; } return renderer ; }
Helper method to lookup a cell renderer based on type .