version copilot

This commit is contained in:
EmmanuelTiamzon
2025-09-26 14:57:00 +02:00
parent e1060e79bd
commit f7de13bc2a
4 changed files with 60 additions and 31 deletions

View File

@@ -0,0 +1,23 @@
import javax.swing.*;
public class GModel {
private ImageIcon[] imgCarousel;
private int index;
public GModel(ImageIcon[] imgCarousel) {
this.imgCarousel = imgCarousel;
this.index = 0;
}
public ImageIcon getImageActuel() {
return this.imgCarousel[this.index];
}
public void imageSuivante() {
this.index = (this.index + 1) % imgCarousel.length;
}
public void imagePrecedente() {
this.index = (this.index - 1 + this.imgCarousel.length) % imgCarousel.length;
}
}