public void drawStar(Graphics g) { // draws the stars for (Star i : starList) { g.drawImage( i.getPics().get(i.getCounter()), i.getX(), i.getY(), i.getWidth(), i.getHeight(), null); i.count(); } }