Controle machine
This commit is contained in:
19
DEV2.1/TP11/01_Image/Image.java
Normal file
19
DEV2.1/TP11/01_Image/Image.java
Normal file
@@ -0,0 +1,19 @@
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user