title: Add border BETWEEN cells in JTable
body: <p>I'm trying to display a JTable as a grid, with lines between the cells. I've only been able to add borders within individual cells, though, which never looks correct; if I add full borders, I get a bunch of disconnected boxes, which looks ugly and wrong. Using MatteBorders (as the below code) looks a little better, but results in gaps where border lines don't quite meet.</p>
  
  <pre><code>public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
      Component stamp = super.prepareRenderer(renderer, row, column);
      int top = 1;
      int left = 1;
      int bottom = row == 7 ? 1 : 0; //Grid is always 8x8, this ensures the bottom/right will have full borders.
      int right = column == 7 ? 1 : 0;
      MatteBorder border = new MatteBorder(top, left, bottom, right, Color.BLACK);
      if (stamp instanceof JComponent) {
          ((JComponent) stamp).setBorder(border);
      }
      return stamp;
  }
  </code></pre>
  
  <p>I feel like there must be some way to do this properly, so that I just get grid lines between cell elements. What am I missing? If nothing else, is there a way to get MatteBorder to stretch across the gaps, or to push a normal border out slightly further so that the borders of adjacent cells overlap?</p>
  
  <p>EDIT: Got it working with setShowGrid(true) and setGridColor(Color.BLACK).</p>