APL/APL2.1/TP6/Acceuil/Accueil_test.java

18 lines
549 B
Java
Raw Normal View History

2022-03-28 15:12:08 +02:00
import java.lang.*;
public class Accueil_test extends JPanel{
private Image menuAcc;
public Accueil_test(){
super();
this.menuAcc = Toolkit.getDefaultToolkit().getImage("menuAcc.jpg");
}
@Override
protected void paintComponent(Graphics pinceau){
Graphics secondPinceau = pinceau.create();
if (this.isOpaque()){
secondPinceau.setColor(this.getBackground());
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
}
secondPinceau.drawImage(this.menuAcc,0,0, this);
}
}