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
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.