lang.NullPointerException

Boa noite, não estou conseguindo fazer a ação do botão rodar, toda hora que clica nele da

Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException
at br.edu.univas.view.ExcluirButton.actionPerformed(ExcluirButton.java:79)

alguem da uma luz pra mim por favor.

package br.edu.univas.view;

import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.AbstractCellEditor;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumnModel;

import br.edu.univas.dao.BatataDAO;
import br.edu.univas.vo.Criativo;

public class ExcluirButton extends AbstractCellEditor
implements TableCellRenderer, TableCellEditor, ActionListener {
JTable table;
JButton renderButton;
JButton editButton;
String text;
private BatataDAO batataDAO;
private ListaBoletos listPanel;

private String nome = "adv";

public ExcluirButton(JTable table, int column) {
    super();
    this.table = table;
    renderButton = new JButton();

    editButton = new JButton("Excluir");
    editButton.setFocusPainted( false );
    editButton.addActionListener( this );

    TableColumnModel columnModel = table.getColumnModel();
    columnModel.getColumn(column).setCellRenderer( this );
    columnModel.getColumn(column).setCellEditor( this );
}

public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    if (hasFocus) {
        renderButton.setForeground(table.getForeground());
        renderButton.setBackground(UIManager.getColor("Button.background"));
    } else if (isSelected) {
        renderButton.setForeground(table.getSelectionForeground());
         renderButton.setBackground(table.getSelectionBackground());
    } else {
        renderButton.setForeground(table.getForeground());
        renderButton.setBackground(UIManager.getColor("Button.background"));
    }

    renderButton.setText( (value == null) ? "Excluir" : value.toString() );
    return renderButton;
}

public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
    text = (value == null) ? "Excluir" : value.toString();
    editButton.setText( text );
    return editButton;
}

public Object getCellEditorValue() {
    return text;
}

@Override
public void actionPerformed(ActionEvent e) {
    fireEditingStopped();
    int l = table.getSelectedRow();
    int result = JOptionPane.showConfirmDialog(null, "Confirmar a exclusão ?");
    
    nome = table.getValueAt(l, 0).toString();
    
    if(result == JOptionPane.YES_OPTION){
        batataDAO.del(nome);
        listPanel.updateTable();
     }else if (result == JOptionPane.NO_OPTION){
        JOptionPane.showMessageDialog(null, "Operação Não");
     }else {
    	 JOptionPane.showMessageDialog(null, "Operação Cancelada");
     }
}

}

Classe que o botão chama:

package br.edu.univas.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import br.edu.univas.vo.Criativo;

public class BatataDAO {

private Connection connection;

public BatataDAO() throws SQLException {
	connection = ConnectionUtil.getConnection();
}

public void save(Criativo criativo) {
	String sql = "insert into divida (nome, valor, data_de_vencimento) "
			+ "values (?, ?, ?)";
	
	try {
		PreparedStatement statement = connection.prepareStatement(sql);
		int index = 1;
		statement.setString(index++, criativo.getName());
		statement.setFloat(index++, criativo.getValor());
		statement.setString(index++, criativo.getData());
		statement.execute();
		
	} catch (SQLException e) {
		e.printStackTrace();
	}
}

public void del(String nome) {
	String sql = "DELETE FROM divida WHERE nome = ?";
	
	try {
		PreparedStatement statement = connection.prepareStatement(sql);
		statement.setString(1, nome);
		statement.execute();
		
	} catch (SQLException e) {
		e.printStackTrace();
	}

}

public List<Criativo> getAll() {
	List<Criativo> criativos = new ArrayList<Criativo>();
	
	String sql = "select * from divida";
	
	try {
		Statement statement = connection.createStatement();
		ResultSet result = statement.executeQuery(sql);
		
		while (result.next()) {
			Criativo criativo = new Criativo();
			criativo.setName(result.getString("nome"));
			criativo.setValor(result.getFloat("valor"));
			criativo.setData(result.getString("data_de_vencimento"));
			criativos.add(criativo);
		}
		
	} catch (SQLException e) {
		e.printStackTrace();
	}
	
	return criativos;
}

}

Qual a instrução da linha 79?
Use o debug, marque esta linha e veja qual variável está “setada” como null.
Essa variável deve ser inicializada.

ele diz que o batataDAO está null, mas eu to passando batataDAO.del(nome); na linha 79

Vc tem que inicializar a variável:
batataDao = new BatataDao();
Depois tem que que fechar a conexão.

try {
		PreparedStatement statement = connection.prepareStatement(sql);
		statement.setString(1, nome);
		statement.execute();
		
	} catch (SQLException e) {
		e.printStackTrace();
	} finally{
            //tem que fechar a conexão aqui ou usar try ressources
       }
}

Vlw cara funciono, salvo eu de fica mais uma noite acordado.