Socorro gente tenho um probleminha aqui, vejam só se alguem pode me HELPAR, abaixo meu metodo para inserir na jtable
public void insertInTable()
{
DAO dao = new DAO();
ArrayList al=dao.sel(0);
ModelTable model = new ModelTable(al);
tb.setModel(model);
tb.setAutoResizeMode(tb.AUTO_RESIZE_OFF);
tb.getColumnModel().getColumn(0).setPreferredWidth(50);
tb.getColumnModel().getColumn(1).setPreferredWidth(276);
}
Classe dao tem o metodo public ArrayList sel(int cliCod) que faz a consulta no banco pra mim
if(cliCod ==0){
sql = "SELECT * FROM clientes WHERE codigo="+cliCod;
minha classe ModelTable extende DefaultTableModel e tb e o nome da variavel da minha tabela, eu chamo o metodo no construtor e quando tento abrir PIMBA,
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at br.com.GUI.GUI.insertInTable(GUI.java:203)
at br.com.GUI.GUI.<init>(GUI.java:27)
O que estou fazendo de errado e muito obrigado pela ajuda. 