IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Concurrence et multi-thread Java Discussion :

[JDIC]Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException


Sujet :

Concurrence et multi-thread Java

  1. #1
    Membre chevronné
    Avatar de kedare
    Homme Profil pro
    Network Automation Engineer
    Inscrit en
    Juillet 2005
    Messages
    1 548
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Network Automation Engineer

    Informations forums :
    Inscription : Juillet 2005
    Messages : 1 548
    Points : 1 861
    Points
    1 861
    Par défaut [JDIC]Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    Salut !
    j'ai un probleme
    j'essai d'utiliser le tray dans mon application
    mais au lancement j'ai cette erreur :
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at javax.swing.ImageIcon.<init>(ImageIcon.java:138)
    at ScreenFrame.formComponentShown(ScreenFrame.java:114)
    at ScreenFrame.access$000(ScreenFrame.java:18)
    at ScreenFrame$1.componentShown(ScreenFrame.java:45)
    at java.awt.Component.processComponentEvent(Component.java:5320)
    at java.awt.Component.processEvent(Component.java:5268)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Window.processEvent(Window.java:1161)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Window.dispatchEventImpl(Window.java:1774)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Voila le bout de code qui contient le tray , je vient de le commencer :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
        private void formComponentShown(java.awt.event.ComponentEvent evt) {
            ImageIcon IconeVerte = new ImageIcon(getClass().getResource("IconGreen.gif"));
            ImageIcon IconeJaune = new ImageIcon(getClass().getResource("IconYellow.gif"));
            ImageIcon IconeRouge = new ImageIcon(getClass().getResource("IconRed.gif"));
            SystemTray allTray = SystemTray.getDefaultSystemTray();
            TrayIcon Tray1 = new TrayIcon(IconeRouge,"Test");
            Tray1.setIconAutoSize(true);
        }
    que faire ?
    merci

  2. #2
    Expert éminent

    Profil pro
    Fabricant et casseur d'avions
    Inscrit en
    Avril 2004
    Messages
    3 813
    Détails du profil
    Informations personnelles :
    Localisation : France, Tarn (Midi Pyrénées)

    Informations professionnelles :
    Activité : Fabricant et casseur d'avions
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Avril 2004
    Messages : 3 813
    Points : 7 638
    Points
    7 638
    Par défaut
    Citation Envoyé par kedare
    que faire ?
    Salut,
    Préciser quelle est cette ligne n°...114 (la verte, la jaune ou la rouge?)
    Eventuellement lancer le debugger pour voir ce qui se passe... pour bien cerner laquelle est à null...
    Ensuite comprendre pourquoi elle est à null... (problème d'accès au fichier?)
    "Errare humanum est, sed perseverare diabolicum"

    Ma page sur DVP.com

  3. #3
    Membre chevronné
    Avatar de kedare
    Homme Profil pro
    Network Automation Engineer
    Inscrit en
    Juillet 2005
    Messages
    1 548
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Network Automation Engineer

    Informations forums :
    Inscription : Juillet 2005
    Messages : 1 548
    Points : 1 861
    Points
    1 861
    Par défaut
    la 114 c'est la verte
    les icones sont au format 20x20

  4. #4
    Expert éminent

    Profil pro
    Fabricant et casseur d'avions
    Inscrit en
    Avril 2004
    Messages
    3 813
    Détails du profil
    Informations personnelles :
    Localisation : France, Tarn (Midi Pyrénées)

    Informations professionnelles :
    Activité : Fabricant et casseur d'avions
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Avril 2004
    Messages : 3 813
    Points : 7 638
    Points
    7 638
    Par défaut
    Il doit y avoir un problème de chemin... où sont placés tes fichiers gif?
    "Errare humanum est, sed perseverare diabolicum"

    Ma page sur DVP.com

  5. #5
    Membre chevronné
    Avatar de kedare
    Homme Profil pro
    Network Automation Engineer
    Inscrit en
    Juillet 2005
    Messages
    1 548
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Network Automation Engineer

    Informations forums :
    Inscription : Juillet 2005
    Messages : 1 548
    Points : 1 861
    Points
    1 861
    Par défaut
    ha oui en effet je vient de voir que le probleme vient de la :/
    je developpe avec netbean , j'ai oublié de copier les fichier dans le repertoir src (mais c'etait bien dans dist)
    Merci :p

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 4
    Dernier message: 08/02/2010, 08h23
  2. Réponses: 5
    Dernier message: 24/02/2008, 22h58
  3. Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException ?
    Par freezerhm dans le forum Concurrence et multi-thread
    Réponses: 5
    Dernier message: 04/12/2007, 09h26
  4. Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    Par Trint dans le forum Interfaces Graphiques en Java
    Réponses: 6
    Dernier message: 27/02/2007, 11h28
  5. Réponses: 8
    Dernier message: 11/05/2006, 19h32

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo