Files
DEV/DEV.2.1/test/test.1/PaintFenetre.java

26 lines
639 B
Java
Raw Normal View History

2025-09-30 09:43:41 +02:00
import.javax.swing.*;
import java.awt.*;
public class PaintFenetre extends JPanel {
private Image MenuDebut;
public PaintFenetre() {
super();
this.MenuDebut = Toolkit.getDefaultToolkit().getImage("../image/MenuDebut.jpg");
}
@Override
public void paintComponent(Graphics pinceau) {
Graphics secondPinceau = pinceau.create();
if(this.isOpaque()) {
secondPinceau.setColor(this.getBackground());
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
}
secondPinceau.clearRect(0, 0, this.getWidth(), this.getHeight());
secondPinceau.drawImage(this.Menu, this.getWidth(), this.getHeight(), this);
}
}