Ciao a tutti!!!
Premetto che non una principiante java... Spero possiate aiutarmi...sono andata in tilt...
Questo è il pezzo di codice :
class EseguiNuovoUtente implements ActionListener {
public void actionPerformed(ActionEvent event){
if ( (dialogAU.tNome.getText().equals(""))||(dialogAU.tCognome.getText().equals(""))||(dialogAU.tcf.getText().equals(""))){
dErrore=new DialogErrore(null, "Errore", true, "Errore: dati inseriti non validi.Inserire Nome Cognome Codice Fiscale dell'utente");
dErrore.setVisible(true);
}
else{
Utente u=new Utente(dialogAU.tNome.getText(),dialogAU.tCognome.getText(),dialogAU.tcf.getText());
Indirizzo i=new Indirizzo(dialogAU.tVia.getText(), dialogAU.tN.getText(),dialogAU.tCap.getText(), dialogAU.tCittà.getText(),dialogAU.tProv.getText());
u.setIndirizzo(i);
biblio.aggiungiUtente(u);/*
ImageIcon imageSuccesso=createImageIcon("./Immagini/4.jpg","SUCCESSO");
dialogSucesso=new DialogS(null, "Operazione riuscita", true,"*_*_* UTENTE AGGIUNTO CON SUCCESSO *_*_* \n\n\n\n"+ u.toString()+ "\n\n ID_Tessera ---> "+u.getId(),imageSuccesso);
dialogSucesso.setVisible(true);
dialogAU.setVisible(false);*/
System.out.println(u.toString());
}
}
Questo è l'errore che mi dà:
Exception occurred during event dispatching:
java.lang.NullPointerException
at grafica.FinestraPrincipale$EseguiNuovoUtente.actionPerformed(FinestraPrincipale.java:400)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6134)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5899)
at java.awt.Container.processEvent(Container.java:2023)
at java.awt.Component.dispatchEventImpl(Component.java:4501)
at java.awt.Container.dispatchEventImpl(Container.java:2081)
at java.awt.Component.dispatchEvent(Component.java:4331)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)
at java.awt.Container.dispatchEventImpl(Container.java:2067)
at java.awt.Window.dispatchEventImpl(Window.java:2458)
at java.awt.Component.dispatchEvent(Component.java:4331)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
at java.awt.Dialog$1.run(Dialog.java:1047)
at java.awt.Dialog$3.run(Dialog.java:1099)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Dialog.java:1097)
at java.awt.Component.show(Component.java:1447)
at java.awt.Component.setVisible(Component.java:1400)
at java.awt.Window.setVisible(Window.java:824)
at java.awt.Dialog.setVisible(Dialog.java:987)
at grafica.FinestraPrincipale$JDialogButtonAUListener.actionPerformed(FinestraPrincipale.java:311)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6134)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5899)
at java.awt.Container.processEvent(Container.java:2023)
at java.awt.Component.dispatchEventImpl(Component.java:4501)
at java.awt.Container.dispatchEventImpl(Container.java:2081)
at java.awt.Component.dispatchEvent(Component.java:4331)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)
at java.awt.Container.dispatchEventImpl(Container.java:2067)
at java.awt.Window.dispatchEventImpl(Window.java:2458)
at java.awt.Component.dispatchEvent(Component.java:4331)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Qual è il mio errore?
Grazie