Basounours
Messages postés4Date d'inscriptionmercredi 3 mai 2006StatutMembreDernière intervention 8 mai 2006
-
8 mai 2006 à 15:31
scaryman
Messages postés492Date d'inscriptionvendredi 30 janvier 2004StatutMembreDernière intervention16 mai 2007
-
8 mai 2006 à 17:10
Bonjour, je suis un debutant en IHM et j'essaie de faire on application assez simple.
La 1ere interface doit me diriger sur une 2ème selon le resultat d'un Checkbox.
le probleme est que j'ai cette erreur
<hr size="2" width="100%">Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at IHM.Bouton_Menu.getChoix(Menu_Ajout.java:69)
at IHM.Bouton_Menu.actionPerformed(Menu_Ajout.java:63)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.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.pumpOneEventForHierarchy(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)
<hr size="2" width="100%">
Ne connaissant rien au thread ... je pige pas grand chose.
voici mon code.
<hr size="2" width="100%">package IHM;
import java.awt.event.*; // Pour le ActionListener
yannick_parchemal
Messages postés31Date d'inscriptionjeudi 13 avril 2006StatutMembreDernière intervention22 mai 2006 8 mai 2006 à 16:18
L'erreur est à la ligne :
return choix.getSelectedCheckbox().getLabel().toString();
tu a oublier d'ajouter tes checkbox à la ChecbokGroup
donc choix.getSelectedCheckbox() rend null
et choix.getSelectedCheckbox().getLabel() provoque l'erreur