Results 1 to 5 of 5
  1. #1
    blu_fox88 is offline Member
    Join Date
    Feb 2010
    Posts
    9
    Rep Power
    0

    Default Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

    I seem to have this problem that wont allow my program to run. I get an exception with the following...

    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at javax.swing.ImageIcon.<init>(ImageIcon.java:167)
    at GUI.initComponents(GUI.java:355)
    at GUI.<init>(GUI.java:30)
    at GUI$21.run(GUI.java:1583)
    at java.awt.event.InvocationEvent.dispatch(Invocation Event.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 597)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:122)
    BUILD SUCCESSFUL (total time: 1 second)





    can anyone help??

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,523
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by blu_fox88 View Post
    I seem to have this problem that wont allow my program to run. I get an exception with the following...

    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at javax.swing.ImageIcon.<init>(ImageIcon.java:167)
    at GUI.initComponents(GUI.java:355)
    at GUI.<init>(GUI.java:30)
    In your GUI constructor you're using a method initComponents() and that method tries to instantiate an ImageIcon at line #355; that ImageIcon instantiation fails; that's all my crystal ball can tell me.

    kind regards,

    Jos

  3. #3
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Question

    Quote Originally Posted by blu_fox88 View Post

    can anyone help??
    Is there an ability to show us the problem piece of code?
    It is also possible to get the error if you use too many concat blocks.

  4. #4
    blu_fox88 is offline Member
    Join Date
    Feb 2010
    Posts
    9
    Rep Power
    0

    Default

    Im not even sure where the problem is....Im using netbeans and this is what it tells me..

  5. #5
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by blu_fox88 View Post
    Im not even sure where the problem is....Im using netbeans and this is what it tells me..

    NullPointerException (Java Platform SE 6) says

    Java Code:
    Thrown when an application attempts to use null in a case where an object is required. These include:
    
        * Calling the instance method of a null object.
        * Accessing or modifying the field of a null object.
        * Taking the length of null as if it were an array.
        * Accessing or modifying the slots of null as if it were an array.
        * Throwing null as if it were a Throwable value. 
    
    Applications should throw instances of this class to indicate other illegal uses of the null object.

    analyzing your code you should localize where an object reference points to null. the numbers in the printStackTrace are the line numbers of the code and helps you to find the location where the exception was thrown.

Similar Threads

  1. Replies: 5
    Last Post: 08-26-2009, 11:37 AM
  2. Replies: 6
    Last Post: 08-03-2009, 08:58 PM
  3. Replies: 10
    Last Post: 01-29-2009, 08:00 AM
  4. Replies: 12
    Last Post: 10-05-2008, 06:52 AM
  5. Replies: 3
    Last Post: 01-29-2008, 01:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •