Java: NullPointerException from class.getResource( … )

后端 未结 5 1865
北海茫月
北海茫月 2020-11-30 14:03

I was writing a small application and when I tried to create an ImageIcon I always got an exception. The exception was caused by this line of code:

prayerLev         


        
5条回答
  •  遥遥无期
    2020-11-30 14:39

    The only thing that can throw a NullPointerException in this line of code is the first ., which means that prayerLevel is null.

提交回复
热议问题