DEV/DEV3.1/TP4:OrganisationCode/GalerieConfirmation/Changement.java

29 lines
821 B
Java
Raw Normal View History

2023-10-05 10:27:11 +02:00
import java.awt.*;
import javax.swing.*;
import java.util.*;
import java.io.*;
public class Changement{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
InputStream file = loader.getResourceAsStream("Main.java");
InputStream file2 = loader.getResourceAsStream("Listeimage.java");
static public void fenetreCliquer(int LR){
2024-09-12 15:34:31 +02:00
Main.fenetre.remove(Main.fenetre.pan);
Main.fenetre.pan.remove(Listeimage.liste[Listeimage.index]);
2023-10-05 10:27:11 +02:00
if (LR==1){
Listeimage.index=Listeimage.index+1;
if(Listeimage.index>4){
Listeimage.index=0;
}
}else {
Listeimage.index=Listeimage.index-1;
if(Listeimage.index<0){
Listeimage.index=4;
}
}
2024-09-12 15:34:31 +02:00
Main.fenetre.pan.add(Listeimage.liste[Listeimage.index]);
Main.fenetre.setContentPane(Main.fenetre.pan);
Main.fenetre.revalidate();
2023-10-05 10:27:11 +02:00
}
}