Code to paint a picture to a panel:
public class MyDraw extends JPanel {
background = new ImageIcon("src/background.jpg").getImage();
@Override
protected void paintComponent(Graphics gr){
super.paintComponent(gr);
gr.drawImage(background, 0, 0, 800, 600, null);
}
}
I want to not to paint a the background picture in this circle, because I want to see the objects behind this circle. I don't want to put the object the front of the image, becuse the circle would move by pressing WASD.
Like this: see image by clicking here.