Ejemplo n.º 1
0
 private void btRemoverActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_btRemoverActionPerformed
   int linhaSelecionada = -1;
   linhaSelecionada = tabela.getSelectedRow();
   if (linhaSelecionada >= 0) {
     int idProduto = (int) tabela.getValueAt(linhaSelecionada, 0);
     ProdutoController pc = new ProdutoController();
     if (pc.remover(idProduto)) {
       tabelmodelo.removeRow(linhaSelecionada);
     }
   } else {
     JOptionPane.showMessageDialog(null, "Nenhuma linha foi selecionada");
   }
 } // GEN-LAST:event_btRemoverActionPerformed