Results 1 to 6 of 6
- 05-08-2009, 02:22 PM #1
Member
- Join Date
- Feb 2009
- Posts
- 6
- Rep Power
- 0
- 05-08-2009, 03:32 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Post the error messages, and the code (in code tags) around where they are being raised.
Many people won't download stuff from forums.
- 05-08-2009, 04:09 PM #3
Member
- Join Date
- Feb 2009
- Posts
- 6
- Rep Power
- 0
Thats what comes up when I try to compile and run the program
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(ImageIcon.java:167)
at finalpkg.gameScreen.<init>(gameScreen.java:28)
at finalpkg.gameScreen$7.run(gameScreen.java:226)
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)
- 05-08-2009, 04:28 PM #4
Crap I had this error on my final project and I'm trying to remember how to fix it. I would get this error in my calculator when I would try to press the = button. It has something to do with listeners on your button trying to access data elsewhere(in my case a BigInteger currentEntry) and manipulating it with other data.
Sorry if that's not much help. The NPE in your event queue has nothing in spot 0. I'm assuming you have a list and loop somewhere? Try changing the starting position to 1 instead.Liberty has never come from the government.
Liberty has always come from the subjects of government.
The history of liberty is the history of resistance.
The history of liberty is a history of the limitation of governmental power, not the increase of it.
- 05-11-2009, 01:08 PM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Well, if you're getting a Null Pointer there then, looking at the ImageIcon code (since you haven't posted the relevant bit of yours), I'm guessing the URL handed to the constructor is null? Of course we might have different versions of Swing...so that might not be the right bit.
- 05-12-2009, 12:19 PM #6
Member
- Join Date
- Mar 2009
- Posts
- 52
- Rep Power
- 0
Similar Threads
-
Whats wrong with this code?
By bbtgirl in forum New To JavaReplies: 2Last Post: 02-25-2009, 03:51 AM -
whats wrong with this class declaration?
By blossompark in forum New To JavaReplies: 5Last Post: 11-30-2008, 02:18 AM -
Whats wrong with my maths???
By soc86 in forum New To JavaReplies: 4Last Post: 11-03-2008, 05:52 PM -
Cannot understand whats wrong
By Lehane_9 in forum New To JavaReplies: 1Last Post: 03-06-2008, 07:57 PM -
Whats wrong with my code???
By Soda in forum New To JavaReplies: 2Last Post: 12-06-2007, 12:54 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks