JTable.setSelectionBackground(Color.blue);

解决方案 »

  1.   

    我没说清楚,不是添颜色,主要是在JTable中指针上下、第一和最末Row的浏览。
      

  2.   

    你可以试一下这个:
    public class YourRender extends DefaultTableCellRenderer {
        public Component getTableCellRendererComponent
           (JTable table, Object value, boolean isSelected,
           boolean hasFocus, int row, int column)
        {
            Component cell = super.getTableCellRendererComponent
               (table, value, isSelected, hasFocus, row, column);
            cell.setBackground( Color.lightGray);
            return cell;
        }}