I am a beginner Java programmer and I have a question for putting image in my java game. In my code, I am putting f but I want to change it with an image of a flag.
How can I use drawImage?
protected void paintComponent(Graphics graphics) {
removeAll();
super.paintComponent(graphics);
if (caseModele.contientFlag()) {
setBackground(Color.WHITE);
graphics.setColor(Color.blue);
graphics.drawString("f", getWidth() / 2, getHeight() / 2);//here
}
}