This commit is contained in:
EmmanuelTiamzon
2025-09-30 09:43:41 +02:00
parent f7de13bc2a
commit 7019a3b7ea
176 changed files with 9458 additions and 149 deletions

Binary file not shown.

View File

@@ -0,0 +1,27 @@
/*Emmanuel SRIVASTAVA-TIAMZON*/
import javax.swing.*;
import java.awt.*;
public class Compteurs extends JComponent {
private Image img;
public Compteurs() {
super();
this.img = Toolkit.getDefaultToolkit().getImage("img.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.setColor(this.getForeground());
secondPinceau.drawImage(this.img, this.getWidth()/2, this.getHeight()/2, this);
}
}

Binary file not shown.

View File

@@ -0,0 +1,28 @@
/*Emmanuel SRIVASTAVA-TIAMZON*/
import java.awt.*;
import javax.swing.*;
public class Fenetre extends JFrame {
public Fenetre() {
super("Compteurs");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setSize(500,500);
this.setLocation(500,250);
Compteurs image6 = new Compteurs();
this.add(image6);
JButton up = new JButton("up");
up.setSize(50,50);
up.setLocation(this.getWidth()/2, this.getHeight()/4);
JButton down = new JButton("down");
down.setSize(50,50);
down.setLocation(this.getWidth()/2, this.getHeight()*4);
this.add(up);
this.add(down);
}
}

BIN
DEV.2.1/CM1/ex3/Main.class Normal file

Binary file not shown.

View File

@@ -0,0 +1,8 @@
/*Emmanuel SRIVASTAVA-TIAMZON*/
public class Main {
public static void main(String[] args) {
Fenetre fenetre = new Fenetre();
fenetre.setVisible(true);
}
}

BIN
DEV.2.1/CM1/ex3/img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB