• Post Reply Bookmark Topic Watch Topic
  • New Topic

Errors in my Program?  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I was watching good ole bucky on the NewBoston do his GUI. I thought to copy it line for line in the hopes of getting my GUI set up so that I can then re-configure it to help me with a personal project of mines. It was great to see that there were not red lines or errors in my program no matter where I checked but then the horror...it failed.

Exception in thread "main" java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(ImageIcon.java:217)
at GUI.<init>(GUI.java:22)
at Launcher.main(Launcher.java:11)


Above is the error I get as well as some lines of code that just refused to work. When I googled up what this means I was told that a null variable was being thrown or something. Coupled with my compiler failing me I just don't know how to get my code to work now. Below is all the code I have which is basically just the main and one other class.







 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Error is caused by lin 22:

Which means that resource "A.JPEG" is not found and method getResource("A.JPEG") returns null.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!