Aide sue exception in thread awt-eventqueue-0 "java.lang.NullPointerException"
cs_sergioramos04
Messages postés16Date d'inscriptionjeudi 6 décembre 2007StatutMembreDernière intervention20 décembre 2012
-
14 nov. 2010 à 17:36
cs_sergioramos04
Messages postés16Date d'inscriptionjeudi 6 décembre 2007StatutMembreDernière intervention20 décembre 2012
-
17 nov. 2010 à 23:33
j'essaye d'afficher les etudiants d'une ville dont le nom est passé dans une JComboBox et voici le message d'erreur
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at extraction.fenetre$1.itemStateChanged(fenetre.java:35)
at javax.swing.JComboBox.fireItemStateChanged(Unknown Source)
at javax.swing.JComboBox.selectedItemChanged(Unknown Source)
at javax.swing.JComboBox.contentsChanged(Unknown Source)
at javax.swing.AbstractListModel.fireContentsChanged(Unknown Source)
at javax.swing.DefaultComboBoxModel.setSelectedItem(Unknown Source)
at javax.swing.JComboBox.setSelectedItem(Unknown Source)
at javax.swing.JComboBox.setSelectedIndex(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
------------------------------------------
merci pour l'aide
A voir également:
Exception in thread "awt-eventqueue-0" java.lang.nullpointerexception
Exception in thread "awt-eventqueue-0" - Meilleures réponses
public class MaFenetre extends JFrame implements Runnable {
//public LinkedList<Etudiant> l=new LinkedList<Etudiant>();
public LinkedList<Etudiant> l; // corriger comme cela
public static JComboBox liste;
........
cs_sergioramos04
Messages postés16Date d'inscriptionjeudi 6 décembre 2007StatutMembreDernière intervention20 décembre 2012 17 nov. 2010 à 23:33
merci, mais voila mon problème:
j'ai une Combobox qui contient 3 ville, lorsque je selection la 1ere ville ca marche il affiche la liste des etudiants appartenant à cette ville,et si je veux selectionner une autre ville il m'affiche cette exception .
-- la ligne 35 :for(Etudiant a:l) /traitement
j'ai cherché dans le web et j'ai trouvé que une variable est utilisée sans etre declarer.
vraiment j'ai utilisé plusieurs choses pour résoudre ce probleme mais sans succes.