22 lines
564 B
Java
22 lines
564 B
Java
|
|
|
|
import javax.swing.JComponent;
|
|
import java.awt.*;
|
|
|
|
public class Bonjour extends JComponent {
|
|
private Image pingouin;
|
|
public Bonjour() {
|
|
super();
|
|
this.pingouin = Toolkit.getDefaultToolkit().getImage("walk-0.png");
|
|
}
|
|
@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.pingouin, 10, 20, this);
|
|
}
|
|
} |