r/javahelp • • Sep 04 '16

GUI programming not working properly.

Why am I getting a null pointer exception? Netbeans is not flagging any errors after I've written the code. I'm getting a null pointer pointer exception, whatever that is.

Exception in thread "main" java.lang.NullPointerException at javax.swing.ImageIcon.<init>(ImageIcon.java:217) at LabelFrame.LabelFrame.<init>(LabelFrame.java:34) at LabelFrame.LabelTest.main(LabelTest.java:13)

Label Frame test class http://pastebin.com/d1bQ11ae Label Frame http://pastebin.com/UQGVNh2f

0 Upvotes

3 comments sorted by

View all comments

1

u/Yeshua7474 Sep 04 '16

start the Image icon path with a forward slash like: "/bug.jpg"