title: Add Jbutton to each row of a Jtable
body: <p>I need ur help, I want to add a Jbutton ( delete button) to each row of a Jtable. Till now, I added the button to each row, but I've a problem with the action. I tried this, but it's not working. When I click the button nothing happens. Can anyone help me please, i'm really stack.
  This is my code :</p>
  
  <pre><code>`public class Fenetre extends JFrame {
  
      Statement stmt;
      Map&lt;Integer,Integer&gt; row_table  = new HashMap&lt;Integer,Integer&gt;();
      JButton addUser;
  
  
    public Fenetre(){
  
      this.setLocationRelativeTo(null);
      this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      this.setTitle("JTable");
      this.setSize(600, 140);
  
      String requeteListeUser=" SELECT * FROM COMPTE_UTILISATEUR";
      try{
      stmt= (Statement) new Connexion().getConnection().createStatement();
      ResultSet resultat= stmt.executeQuery(requeteListeUser);
       resultat.last();
      String  title[] = {"Nom","Prenom","Matricule","Action"};
       int rowCount = resultat.getRow();
  
       Object[][] data  = new Object[rowCount][4];
  
       final JTable tableau = new JTable(data,title);
       JButton jButton2= new JButton("Supprimer");
  
  
  
      // this.tableau = new JTable(model);
      tableau.getColumn("Action").setCellRenderer(new ButtonRenderer());
  
      this.getContentPane().add(new JScrollPane(tableau), BorderLayout.CENTER); 
      int i=0;
          resultat.beforeFirst(); // on repositionne le curseur avant la première ligne 
          while(resultat.next()) //tant qu'on a quelque chose à lire
          {   
              //Remplire le tableau à deux dimensions Data[][] 
              for(int j=1;j&lt;=4;j++)
              {
                   if(j != 4)data[i][j-1]=resultat.getObject(j)+"";
                   else { data[i][j-1] = jButton2;
                   jButton2.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
  
  
                   ((DefaultTableModel)tableau.getModel()).removeRow(tableau.getSelectedRow());
                              }
                              });
                              }
                             }
  
              i++; 
              row_table.put(i, resultat.getInt("id_utilisateur"));
  
          }
   }
      catch(SQLException ex){
      System.out.println(ex);
      }
  
      addUser = new JButton("Ajouter un utilisateur");
      addUser.setPreferredSize(new Dimension(60,30));
      addUser.addActionListener(new ActionListener(){
  
          @Override
          public void actionPerformed(ActionEvent arg0) {
              new AjouterUtilisateur().setVisible(true);
          }
  
      });
  
      this.getContentPane().add(addUser,BorderLayout.SOUTH);
    }
  
    //Classe modèle personnalisée
    class ZModel extends AbstractTableModel{
      private Object[][] data;
      private String[] title;
  
      //Constructeur
      public ZModel(Object[][] data, String[] title){
        this.data = data;
        this.title = title;
      }
  
      //Retourne le nombre de colonnes
      public int getColumnCount() {
        return this.title.length;
      }
  
      //Retourne le nombre de lignes
      public int getRowCount() {
        return this.data.length;
      }
  
      //Retourne la valeur à l'emplacement spécifié
      public Object getValueAt(int row, int col) {
        return this.data[row][col];
      }   
  }
  
    public class ButtonRenderer extends JButton implements TableCellRenderer{
  
      public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean isFocus, int row, int col) {
        //On écrit dans le bouton ce que contient la cellule
        setText("Suuprimer");
        //On retourne notre bouton
        return this;
  
      }
    }
   public static void main(String[] args){
      //Fenetre fen = new Fenetre();
      new Menu().setVisible(true);
    }
  }`
  </code></pre>