19 lines
448 B
Java
19 lines
448 B
Java
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);
|
|
|
|
}
|
|
} |