Exception occurred during event dispatching:
java.lang.NullPointerException
at Nodo.<init><Nodo.java:17>
at Gerente.<init><Gerente.java:32>
at Inclusao.actionPerformed<Inclusao.java:96>
at java.awt.Button.processActionEvent<Button.java:329>
at java.awt.Button.processEvent<Button.java:302>
at java.awt.Component.dispatchEventImpl<Component.java:2593>
at java.awt.Component.dispatchEvent<Component.java:2497>
at java.awt.EventQueue.dispatchEvent<EventQueue.java:339>
at java.awt.EventDispatchThread.pumpOneEventForHierarchy<
EventDispatchThread.java:131>
at java.awt.EventDispatchThread.pumpEventsForHierarchy<
EventDispatchThread.java:98>
at java.awt.EventDispatchThread.pumpEvents<EventDispatchThread.java:93>
at java.awt.EventDispatchThread.run<EventDispatchThread.java:85>
// tira a janela da memóriathis.dispose();}if(e.getSource()==b2){// limpa todos os campostf1.setText("");tf2.setText("");tf3.setText("");// direciona o cursor para o tf1tf1.requestFocus();}if(e.getSource()==b1){intaux;aux=Integer.parseInt(tf1.getText());Gerenteg=newGerente(lista,aux,tf2.getText(),tf3.getText());}}
Classe Gerente:
public class Gerente
{
// atributos de Gerente
privateListalista;privateFitafita;privateNodonodo;privateHashhash;// Métodos//ConstrutorpublicGerente(Listal,intc,Stringg,Stringn){intaux2;NodonodoAux;lista=l;fita=newFita();fita.setCodigo(c);fita.setGenero(g);fita.setNome(n);nodo=newNodo();nodo.setObjeto(fita);// pegando a chave hashhash=newHash();intchaveAux=hash.funcaoHash(c);// inserindo o nodo na listalista.insereNaLista(nodo,chaveAux);}
}
Fernando_Generoso_da
serve essas classes massardi?
há erros nelas?
Bani
O erro está na classe Nodo, linha 17, que não foi colocada em sua mensagem.
Fernando_Generoso_da
classe Nodo:
publicclassNodolinha5{linha6// atributos da classe linha…privateNodoant;privateNodoprox;privateFitaobjeto;