title: How to gray-out non-editable cell in jtable?
body: <p>I want to gray non-editable cell in JTable.
  I'm using such TableCellRenderer:</p>
  
  <pre><code>TableColumn column = table.getColumnModel().getColumn(0);
  column.setCellRenderer(new GrayableCheckboxCellRenderer());
  
  public class GrayableCheckboxCellRenderer extends JCheckBox implements TableCellRenderer {
      public Component getTableCellRendererComponent(JTable table, Object value,
              boolean isSelected, boolean hasFocus, int vRowIndex, int vColIndex) {           
              boolean editable = isEditable(vRowIndex, vColIndex);
          setBackground(editable ? UIManager.getColor("Label.background") : Color.LIGHT_GRAY);
          setSelected((Boolean) value);
                  if (isSelected) {
                      // TODO: cell (and perhaps other cells) are selected, need to highlight it
                  }
          return this;
      }
      // perfomance
      protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {}
      public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {}
      public void revalidate() {}
      public void validate() {}
  }
  </code></pre>
  
  <p>This works but with one annoying artefact:
  Initially "checkbox" is "left-arranged", when I press left mouse button it moves to "center-arranged" and when I release mouse button it moves back to "left-arranged".</p>
  
  <p>How to avoid such annoying artefact and probably there are better simpler solution for my problem?</p>