26 lines
639 B
Java
26 lines
639 B
Java
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);
|
|
}
|
|
|
|
|
|
} |