Files
DEV/DEV.2.1/TP/TP11-Flux-octets/1./Image.java

19 lines
448 B
Java
Raw Normal View History

2025-09-30 09:43:41 +02:00
import java.awt.*;
import javax.swing.*;
import java.io.*;
public class Image extends JComponent {
@Override
public void paintComponent(Graphics pinceau) {
Graphics secondPinceau = pinceau.create();
Color couleur;
if (this.isOpaque()) {
secondPinceau.setColor(this.getBackground());
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
}
secondPinceau.drawImage(new LectureFichier().getImage(), 0, 0, this);
}
}