Why does my icon handling code throw a NullPointerException?

后端 未结 6 2235
梦如初夏
梦如初夏 2020-12-16 07:12

I have added an image for my button,but when I run that frame this exception will be thrown .why?please help me.

init:

deps-jar:
compile-single:
run-single:         


        
6条回答
  •  暖寄归人
    2020-12-16 07:55

    It looks like getClass().getResource("/Images/yahoo_1.gif") returns null i.e. the .gif cannot be found on your classpath. (Images versus images maybe?)

提交回复
热议问题