I create a frame with an image with this code:
JFrame f = new JFrame();
try {
f.setContentPane(new JLabel(new ImageIcon(ImageIO.read(new File("image.jpg")))));
}
catch (IOException e) {
e.printStackTrace();
}
f.pack();
f.setVisible(true);
That works fine, but now I want to paint something in that opened frame (on top of the image).
I'm quite new in Java, and I've allready tried to make a class that extends JFrame, with a paint(Graphics g) method in it, but it wouldn't work, I only see the image...