title: JTable single click select entire line of selected cell, double click edit row
body: <p>I have a project where I have a JTable and :</p>
  
  <ul>
  <li>on single click on a row must select the entire line from jtable not only the clicked cell</li>
  <li>on double click on a cell that row must be editable</li>
  </ul>
  
  <p>I use Netbeans IDE, if relevant.</p>
  
  <p>The JTable code :</p>
  
  <pre><code>public class ModelTabelAbonati extends AbstractTableModel {
  
  Abonat[] tabelAbonati = new Abonat[0];
  
  
  public void Adauga (String nume, String prenume, String cnp, Integer telefon){
      tabelAbonati= Arrays.copyOf(tabelAbonati, tabelAbonati.length+1);
      tabelAbonati[tabelAbonati.length-1]=new Abonat (nume,prenume, cnp, telefon);
      fireTableRowsInserted(tabelAbonati.length-1, tabelAbonati.length-1);
  }
  
  
  public void Adauga(String nume, String prenume, String cnp, int telefon){
      tabelAbonati= Arrays.copyOf(tabelAbonati, tabelAbonati.length+1);
      tabelAbonati[tabelAbonati.length-1]=new Abonat (nume,prenume, cnp, telefon);
      fireTableRowsInserted(tabelAbonati.length-1, tabelAbonati.length-1);
  }
  
  
  
  
  @Override
  public String getColumnName(int column){
      return new String[]{"Nr. ","Nume ","Prenume ","CNP ","Tel. Fix ","Tel. Mobil"}[column];
  }
  
  
  @Override
  public int getRowCount() {
      return tabelAbonati.length;
  }
  
  @Override
  public int getColumnCount() {
      return 6; 
  }
  
  @Override
  public Object getValueAt(int rowIndex, int columnIndex) {
  
      Abonat a= tabelAbonati[rowIndex];
  
      switch (columnIndex){
  
      case 0: return rowIndex+1;
      case 1: return a.getNume();
      case 2: return a.getPrenume();
      case 3: return a.getCnp();
      case 4: return a.getTelefon().getTelFix();
      case 5: return a.getTelefon().getTelMobil();
      default: return "ERROR";
  
  
  }
  
  }
  
  }
  </code></pre>