Error with timer and JFrame

后端 未结 3 1697
夕颜
夕颜 2021-01-29 13:36

I\'m making a game with a timer and a JFrame (and many other things but only these 2 are causing problems), and after running the segments below, I got a weird error. At least f

3条回答
  •  粉色の甜心
    2021-01-29 14:32

    You get NPE because you are passing null as graphics in window.paintComponents(null); And then you are calling g.drawImage(j.getImage(),j.getX(), j.getY(), null); where g is null.

提交回复
热议问题