title: How to set color border to row Selection jtable?
body: <p>I have a JTable and I want when selecting a row in the table it will be colored blue and have a green border marked around the row.
  I was able to make the color blue but can not make a green border marked around the row .
  I have attached a picture -This is what it should be.</p>
  
  <p><a href="http://i.stack.imgur.com/P6BdR.png" rel="nofollow">enter image description here</a></p>
  
  <p>Thanks in advance
  After editing:
  I add to my code :</p>
  
  <pre><code> JTable jTable1 = new JTable( model )
  {
    //  Returning the Class of each column will allow different
    //  renderers to be used based on Class
    public Class getColumnClass(int column)
    { 
         return columns[column];
    }
    @Override
      public boolean isCellEditable(int row, int column) {
         //all cells false
         return false;
      }
  
    @Override
      public Component prepareRenderer(TableCellRenderer renderer, int row, int col) {
        Component c = super.prepareRenderer(renderer, row, col);
                JComponent jc = (JComponent)c;
              if (isRowSelected(row)){
                  int top = (row &gt; 0 &amp;&amp; isRowSelected(row-1))?1:2;
                int left = col == 0?2:0;
                int bottom = (row &lt; getRowCount()-1 &amp;&amp; isRowSelected(row + 1))?1:2;
                int right = col == getColumnCount()-1?2:0;
                  jc.setBorder(BorderFactory.createMatteBorder(top, left, bottom, right, new Color(210,236,204))); 
                  jc.setForeground(new Color(164, 164, 172));
              }
              else{
                jc.setBorder(null);
              }             
          int selCol = -2;
          int selRow = jTable1.getSelectedRow();
  
          if ( selCol != -1 &amp;&amp; selRow != -1 ){
              if ( row == selRow || col == selCol){
                  c.setBackground(new Color(249,250,254));    
              }else
                  c.setBackground(Color.WHITE);
          }
          return c;
      }
  };
  </code></pre>
  
  <p>And I almost got What I wanted, but if you look closely the color missing between each cell.
  What should I do?</p>
  
  <p>This is what I have now</p>
  
  <p><a href="http://i.stack.imgur.com/WAWKY.png" rel="nofollow">enter image description here</a></p>