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

29 lines
786 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){
Main.fenetre.remove(Main.pan);
Main.pan.remove(Listeimage.liste[Listeimage.index]);
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;
}
}
Main.pan.add(Listeimage.liste[Listeimage.index]);
Main.fenetre.setContentPane(Main.pan);
Main.fenetre.repaint();
}
}