big update

This commit is contained in:
EmmanuelTiamzon
2025-10-08 16:39:06 +02:00
parent da05a19bd9
commit 1e25b6a3ae
36 changed files with 222 additions and 93 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

View File

@@ -0,0 +1,21 @@
import java.awt.*;
import javax.swing.*;
public class GFenetre extends JFrame {
public GFenetre() {
super("Galerie");
this.setSize(1000, 600);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new GridLayout(1,1));
JLabel imgJLabel = new JLabel(new ImageIcon("../res/MICHEL.gif"));
this.add(imgJLabel, BorderLayout.CENTER);
this.add(imgJLabel);
this.addMouseListener(new GestionSouris(imgJLabel ,this));
}
}

View File

@@ -0,0 +1,52 @@
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseListener;
import java.awt.event.MouseEvent;
public class GestionSouris implements MouseListener {
private JLabel img;
private String[] images;
private int actuel;
private GFenetre gfenetre;
public GestionSouris(JLabel img, GFenetre gfenetre) {
this.img = img;
this.gfenetre = gfenetre;
String[] temp = {
"../res/MICHEL.gif",
"../res/image1.jpeg",
"../res/imag2.jpeg"
};
this.images = temp;
this.actuel = 0;
}
@Override
public void mouseClicked(MouseEvent evenement) {
if (evenement.getX() < this.gfenetre.getWidth()/2) {
this.actuel--;
if (this.actuel == -1) {
this.actuel = 3;
}
}
else {
this.actuel++;
if (this.actuel == 4) {
this.actuel = 0;
}
}
this.gfenetre.getContentPane().removeAll();
this.gfenetre.add(new JLabel(new ImageIcon(this.images[this.actuel])));
this.gfenetre.revalidate();
this.gfenetre.repaint();
}
public void mousePressed(MouseEvent e) {}
public void mouseReleased(MouseEvent e) {}
public void mouseEntered(MouseEvent e) {}
public void mouseExited(MouseEvent e) {}
}

View File

@@ -0,0 +1,10 @@
import java.awt.*;
import javax.swing.*;
public class Main {
public static void main(String[] args) {
GFenetre fenetre = new GFenetre();
fenetre.setVisible(true);
}
}