apl/APL2.1/TP6_Dessin/tp06/Accueil.java
unknown d9949b5cb0 a
2022-01-14 06:54:18 +01:00

25 lines
615 B
Java

import javax.swing.JComponent;
import java.awt.*;
public class Accueil extends JComponent
{
private Image fond;
public Accueil()
{
super();
this.fond = Toolkit.getDefaultToolkit().getImage("login.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.fond, 0, 0, this);
}
}