Results 1 to 7 of 7
  1. #1
    Fajkowsky is offline Member
    Join Date
    Sep 2012
    Posts
    3
    Rep Power
    0

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

    Hello I have this problem:
    Java Code:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    	at swingi.dodajSamochod.jButton1ActionPerformed(dodajSamochod.java:473)
    	at swingi.dodajSamochod.access$200(dodajSamochod.java:17)
    	at swingi.dodajSamochod$3.actionPerformed(dodajSamochod.java:199)
    	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
    	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    	at java.awt.Component.processMouseEvent(Component.java:6505)
    	at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
    	at java.awt.Component.processEvent(Component.java:6270)
    	at java.awt.Container.processEvent(Container.java:2229)
    	at java.awt.Component.dispatchEventImpl(Component.java:4861)
    	at java.awt.Container.dispatchEventImpl(Container.java:2287)
    	at java.awt.Component.dispatchEvent(Component.java:4687)
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    	at java.awt.Container.dispatchEventImpl(Container.java:2273)
    	at java.awt.Window.dispatchEventImpl(Window.java:2719)
    	at java.awt.Component.dispatchEvent(Component.java:4687)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
    	at java.awt.EventQueue.access$200(EventQueue.java:103)
    	at java.awt.EventQueue$3.run(EventQueue.java:682)
    	at java.awt.EventQueue$3.run(EventQueue.java:680)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    	at java.awt.EventQueue$4.run(EventQueue.java:696)
    	at java.awt.EventQueue$4.run(EventQueue.java:694)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
    And I don't know what to do with this. can someone help?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

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

    Quote Originally Posted by Fajkowsky View Post
    Hello I have this problem:
    ...
    And I don't know what to do with this.
    The exception is telling you where the NPE is occurring:

    Java Code:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    	at swingi.dodajSamochod.jButton1ActionPerformed(dodajSamochod.java:473) ***** here *****
    You'll need to check the variables on that line as one of them is null, then back-track into your code to find out why it's null.

  3. #3
    Fajkowsky is offline Member
    Join Date
    Sep 2012
    Posts
    3
    Rep Power
    0

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

    I even try call method like this:
    Java Code:
     save.car("", "");
    Still I have this errors. And my method has this construction :
    Java Code:
    public void car(String markaNazwa, String modelNazwa) {...}

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

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

    If you need our help, you'll have to give us more information. For instance if you're still seeing the NPE, then show us the line of code that is causing it, and related code including code that shows where you've created the objects used on that line. Unfortunately we're not mind readers.

  5. #5
    Fajkowsky is offline Member
    Join Date
    Sep 2012
    Posts
    3
    Rep Power
    0

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

    Sorry, bad day.

    So in package "swingi" I have class "dodajSamochod.java" there I call "zapisz.samochod("","");".

    Komis.zip - Speedy Share - upload your files here

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

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

    If you're expecting members to download a while lot of irrelevant code to find where you've gone wrong, don't hold your breath while you're waiting. Moreover, for many members, file sharing sites are blocked by corporate firewalls.

    To get better help sooner, post a SSCCE (Short, Self Contained, Correct (Compilable), Example) that demonstrates the problem.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  7. #7
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

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

    Quote Originally Posted by Fajkowsky View Post
    So in package "swingi" I have class "dodajSamochod.java"
    Learn to follow the Java coding conventions. Class names should start with an uppercase letter.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 3
    Last Post: 01-19-2011, 06:54 AM
  2. Replies: 1
    Last Post: 12-13-2010, 03:19 PM
  3. Replies: 6
    Last Post: 06-06-2010, 09:02 PM
  4. Replies: 3
    Last Post: 04-30-2010, 07:44 PM
  5. Replies: 5
    Last Post: 08-26-2009, 11: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
  •