Rechercher : dans
Par :

"AWT-EventQueue-0" java.lang.NullPointer

Dernière réponse le 18 jun 2008 à 06:17:51 nanou, le 18 jun 2008 à 05:13:01 
 Signaler ce message aux modérateurs

Salut

Bon moi j ai un gros probleme et j ai vraiment besoin de votre aide
donc j ai deux combobox dans la premiere j ai des services et dans la deuxieme j ai les debits utilisés pour ces services
il faut que quand je fixe le service "voice" dans le 1er combobox le 2eme combobox affiche seulement le débit "12.2" et devient disabled . Pour ça j ai écris un code qui a fonctionné:

private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int modifiers;
if (evt instanceof ActionEvent) {
modifiers = ((ActionEvent)evt).getModifiers();
long modsLong = modifiers & ActionEvent.MOUSE_EVENT_MASK;
if (modsLong == MouseEvent.BUTTON1_MASK) {
// System.out.println(this.jComboBox1.getItemAt(this.jComboBox1.getSelectedIndex()).toString());
if(this.jComboBox1.getItemAt(this.jComboBox1.getSelectedIndex()).toString().equalsIgnoreCase("voice")){
this.jComboBox2.removeAllItems();
this.jComboBox2.addItem("12.2");
this.jComboBox2.setEnabled(false);
}else
GetServicesRate();

}
}
mais seulement au début maintenant quand je sélectionne voice dans le combobox1 il n'affiche plus rien dans le combobox2 et l affichage devient bizare et quand j essaye de selectionner un autre service l affichage ne change pas et le combobox2 reste aussi vide.
et l'exception suivante apparait:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:991)
at java.lang.Double.parseDouble(Double.java:510)
at BudgetLink_View.TestingForm.jComboBox2ActionPerformed(TestingForm.java:648)
at BudgetLink_View.TestingForm.access$100(TestingForm.java:22)
at BudgetLink_View.TestingForm$2.actionPerformed(TestingForm.java:143)
at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1242)
at javax.swing.JComboBox.contentsChanged(JComboBox.java:1313)
at javax.swing.JComboBox.intervalRemoved(JComboBox.java:1333)
at javax.swing.AbstractListModel.fireIntervalRemoved(AbstractListModel.java:161)
at javax.swing.DefaultComboBoxModel.removeAllElements(DefaultComboBoxModel.java:169)
at javax.swing.JComboBox.removeAllItems(JComboBox.java:753)
at BudgetLink_View.TestingForm.GetServicesRate(TestingForm.java:710)
at BudgetLink_View.TestingForm.jComboBox1ActionPerformed(TestingForm.java:607)
at BudgetLink_View.TestingForm.access$000(TestingForm.java:22)
at BudgetLink_View.TestingForm$1.actionPerformed(TestingForm.java:134)
at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1242)
at javax.swing.JComboBox.setSelectedItem(JComboBox.java:569)
at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:605)
at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:814)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:480)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

Merci pour votre aide c tres urgent!!!

Configuration: Windows XP
Internet Explorer 7.0

Meilleures réponses pour « "AWT EventQueue 0" java.lang.NullPointer » dans :
[Logiciel libre] Installation firefox 2.0+java+flash VoirInstallation firefox 2.0+java+flash en ligne de commande A. INTRODUCTION B. INSTALLATION FIREFOX 1. Création d'environnement 2. Téléchargement et vérification de la signature 3. Installation de Firefox 4. Démarrage de l'application C....
[Firefox] plugin Java Jre de Sun VoirA) Les différentes variantes Java chez Sun B) Installation sous Mandriva Limited Edition 2005 ETAPE 1 ETAPE 2: Création du lien symbolique C) Installation sous debian lenny D) Installation sous ubuntu hardy heron A) Les différentes...
Télécharger Java Runtime Environment VoirJava Runtime Environment (JRE) installe la machine virtuelle Java, permettant de jouer en ligne, de discuter avec des personnes dans le monde entier, de calculer les intérêts de votre prêt immobilier ou de visualiser des images en 3D. Ces...
Java - Caractéristiques du langage VoirFichier source, compilation et machine virtuelle Le fichier source d'un programme écrit en Java est un simple fichier texte dont l'extension est par convention .java. Ce fichier source doit être un fichier texte non formatté, c'est-à-dire un...
Java - Les packages VoirIntroduction aux packages La programmation Java consiste à créer des classes. Or, étant donné qu'un programme est généralement développé par une équipe de programmeurs, c'est-à-dire plusieurs personnes, le fait de concaténer (mettre bout à bout)...

1

 alexdelareunion, le 18 jun 2008 à 06:17:51
  • +2

C'est surement dans

at BudgetLink_View.TestingForm.jComboBox2ActionPerformed(Testin­gForm.java:648)

Je ne comrends pas bien tous les contrôles que tu fais dans ton Evenement, ça me semble étrange

Répondre à alexdelareunion