Results 1 to 4 of 4
  1. #1
    Scyth3 is offline Member
    Join Date
    Nov 2012
    Posts
    12
    Rep Power
    0

    Default Error in .jar, but no error in netbeans

    I will be uploading a video soon, but I run my 2d game in netbeans, and I can play it. But I run the jar from netbeans, and I get some weird errors...

    Java Code:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at javax.swing.ImageIcon.<init>(Unknown Source)
            at Frames.GameFrame.<init>(GameFrame.java:26)
            at Frames.GameFrame.main(GameFrame.java:49)
            at Listeners.MyActionListener.actionPerformed(MyActionListener.java:19)
            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 Sour
    ce)
            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.dispatchEventImpl(Unknown Source)
            at java.awt.EventQueue.access$200(Unknown Source)
            at java.awt.EventQueue$3.run(Unknown Source)
            at java.awt.EventQueue$3.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
    ce)
            at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
    ce)
            at java.awt.EventQueue$4.run(Unknown Source)
            at java.awt.EventQueue$4.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
    ce)
            at java.awt.EventQueue.dispatchEvent(Unknown Source)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForFilter(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)
    I don't know what to make of it. I don't get any errors in netbeans
    Last edited by Scyth3; 01-27-2013 at 04:43 PM. Reason: spelling error

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

    Default Re: Error in .jar, but no error in netbeans

    The NPE is telling you to key in on lines 26 and 49 of your GameFrame.java class. My bet is that you're trying to read an image in from a jar file as a file (which doesn't exist in jar files) rather than as a resource.

  3. #3
    Scyth3 is offline Member
    Join Date
    Nov 2012
    Posts
    12
    Rep Power
    0

    Default Re: Error in .jar, but no error in netbeans

    I fixed it. Thanks

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

Similar Threads

  1. NetBeans 6.8 Execute through OTA error
    By Chirieac in forum NetBeans
    Replies: 0
    Last Post: 01-04-2010, 02:56 PM
  2. Netbeans Error?
    By makpandian in forum NetBeans
    Replies: 3
    Last Post: 05-07-2009, 07:22 AM
  3. Deployment error in Netbeans
    By ruchira mathur in forum NetBeans
    Replies: 1
    Last Post: 01-06-2009, 08:08 AM
  4. NetBeans IDE 5 server error
    By aditya in forum NetBeans
    Replies: 0
    Last Post: 10-28-2008, 04:56 AM
  5. NetBeans error
    By michcio in forum New To Java
    Replies: 1
    Last Post: 01-27-2008, 11:09 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
  •