isSelected in jtable help me

gente to com um pequeno probleminha eu tenho um metodo

public Component getTableCellRendererComponent(
                JTable table,
                Object value,
                boolean isSelected,
                boolean hasFocus,
                int row,
                int column) {
            Component result = super.getTableCellRendererComponent(
                    table,
                    value,
                    isSelected,
                    hasFocus,
                    row,
                    column);

                return result;        
        }

so que nao consigo de maneira nenhuma manipular o isSelected para mim quando selecionar uma linha da minha jtable ele mudar de cor quando selecionar alguem pode me ajudar ? agradeco desde ja!

tentei isso mas nao funcionou

if(isSelected) { result.setForeground(Color.RED); result.setBackground(Color.MAGENTA); }

@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (isSelected) { if (row == itsRow) { this.setBackground(Color.BLUE); this.setForeground(Color.WHITE); } else { this.setBackground(Color.WHITE); this.setForeground(Color.BLUE); } } return this; }