Painting Graphics2D in a JFrame
问题 I'm making a 2d vertical shooter game, in which everything is coded (and working) but the graphics. I have not used the Graphics classes before, so this is all new to me. The following is the code I use to paint everything to the JFrame: public void paintAll() { Graphics h = new Graphics2D(); for(Bullet j : GameState.getEnBullets()){ h.drawImage(j.getImage(),j.getX(), j.getY(), null);} for(Enemy j : GameState.getEnemies()){ h.drawImage(j.getImage(),j.getX(), j.getY(), null);} for(Bullet j :