Can anyone tell me why this ain’t double buffering?
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D) screen.getGraphics();
g2d.setColor(Color.black);
g2d.fillRect(0, 0, 640,480);
for(int i = 0; i < stars.length; i++){
g2d.setColor(new Color(stars[i].r, stars[i].g, stars[i].b));
g2d.fillRect(stars[i].x, stars[i].y, (int) stars[i].size, (int) stars[i].size);
}
g.drawImage(screen, 0, 0, null);
}