title: custom cell renderer for particular row and column
body: <p>puuuuuuf, I'm starting to like swing :) I'm trying to write a cellRenderer to customy render all cells besides those which in first row and column. So I wrote the following:  </p>
  
  <pre><code>public class CustomTableCellRenderer extends DefaultTableCellRenderer {
          public Component getTableCellRendererComponent(JTable table, Object obj, boolean isSelected, boolean hasFocus, int row, int column) {
              Component cell = super.getTableCellRendererComponent(table, obj, isSelected, hasFocus, row, column);
  
              if(row &gt;0&amp;&amp;column&gt;0){
                  cell.setBackground(Color.GREEN);
              }
  
              return cell;
          }
      }
  </code></pre>
  
  <p>and set the renderer as following:  </p>
  
  <pre><code>scheduleTable.setDefaultRenderer(Object.class, new CustomTableCellRenderer()); 
  </code></pre>
  
  <p>but for some reason such an approach applies renderer to all the cell. So all of them are Green. If I'm doing something wrong, could you help me with that please?  </p>
  
  <p>Thanks in advance!  </p>
  
  <h2>ADDITION</h2>
  
  <pre><code>scheduleTable = new JTable() {
                      @Override
                      public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
                          Component comp = super.prepareRenderer(renderer, row, column);
                          int modelRow = convertRowIndexToModel(row);
                          int modelColumn = convertColumnIndexToModel(column);
                          if (modelColumn != 0 &amp;&amp; modelRow != 0) {
                              comp.setBackground(Color.GREEN);
                          }
                          return comp;
                      }
                  };  
  </code></pre>
  
  <p>this code makes all the table green as well.  </p>
  
  <p>This code:</p>
  
  <pre><code>scheduleTable = new JTable(tableModel) {
                      @Override
                      public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
                          Component comp = super.prepareRenderer(renderer, row, column);
                          int modelRow = convertRowIndexToModel(row);
                          int modelColumn = convertColumnIndexToModel(column);
  
                              if (modelRow != 0 &amp;&amp; modelColumn != 0) {
                                  setBackground(Color.GREEN);
                              } else {
                                  setBackground(Color.WHITE);
                              }
  
                          return comp;
                      }
                  };
  </code></pre>
  
  <p>gives me the following result ;(<br>
  <img src="https://i.stack.imgur.com/qvlUh.png" alt="enter image description here"></p>
  
  <p>The following situations I have with differents <code>n</code> in expression <code>row != 0 &amp;&amp; column != 0</code>:<br>
  <img src="https://i.stack.imgur.com/KkxVN.jpg" alt="enter image description here"></p>