Results 1 to 4 of 4
- 01-27-2013, 05:42 PM #1
Member
- Join Date
- Nov 2012
- Posts
- 12
- Rep Power
- 0
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)
Last edited by Scyth3; 01-27-2013 at 05:43 PM. Reason: spelling error
-
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.
- 01-27-2013, 06:10 PM #3
Member
- Join Date
- Nov 2012
- Posts
- 12
- Rep Power
- 0
Re: Error in .jar, but no error in netbeans
I fixed it. Thanks
-
Re: Error in .jar, but no error in netbeans
Similar Threads
-
NetBeans 6.8 Execute through OTA error
By Chirieac in forum NetBeansReplies: 0Last Post: 01-04-2010, 03:56 PM -
Netbeans Error?
By makpandian in forum NetBeansReplies: 3Last Post: 05-07-2009, 08:22 AM -
Deployment error in Netbeans
By ruchira mathur in forum NetBeansReplies: 1Last Post: 01-06-2009, 09:08 AM -
NetBeans IDE 5 server error
By aditya in forum NetBeansReplies: 0Last Post: 10-28-2008, 05:56 AM -
NetBeans error
By michcio in forum New To JavaReplies: 1Last Post: 01-27-2008, 12:09 PM
Bookmarks