@Override
        public Component getTableCellRendererComponent(JTable table,
                Object value, boolean selected, boolean focused,
                int row, int column) {
            super.getTableCellRendererComponent(table, value,
                    selected, focused, row, column);

            Color bg;
            if (!selected) {
                bg = (row % 2 == 0 ? alternateColor : whiteColor);
            } else {
                bg = selectedColor;
            }
            setBackground(bg);
            setForeground(Color.black);
            return this;
        }