5 Octobre

This commit is contained in:
Adrian POURCHOT 2023-10-05 10:27:11 +02:00
parent 2bb0dfa259
commit 22b6d39736
33 changed files with 169 additions and 40 deletions

Binary file not shown.

View File

@ -0,0 +1,29 @@
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();
}
}

Binary file not shown.

View File

@ -2,9 +2,13 @@ import java.awt.*;
import javax.swing.*; import javax.swing.*;
import java.awt.event.*; import java.awt.event.*;
import java.util.*; import java.util.*;
import java.io.*;
public class Galerie extends JPanel implements MouseListener{ public class Galerie extends JPanel implements MouseListener{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
InputStream file = loader.getResourceAsStream("Changement.java");
public Galerie(){ public Galerie(){
super(); super();
} }

View File

@ -1,23 +0,0 @@
import java.awt.*;
import javax.swing.*;
import java.util.*;
public class Changement{
static public void fenetreCliquer(int LR){
Main.pan.remove(Listeimage.liste[Listeimage.index]);
if (LR==1){
Listeimage.index+=1;
if(Listeimage.index==-1){
Listeimage.index=5;
}
}else {
Listeimage.index-=1;
if(Listeimage.index==6){
Listeimage.index=0;
}
}
Main.pan.add(Listeimage.liste[Listeimage.index]);
Main.pan.repaint();
}
}

View File

@ -1,15 +0,0 @@
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
public class Listeimage{
static JLabel image1 = new JLabel(new ImageIcon("image1.jpg"));
static JLabel image2 = new JLabel(new ImageIcon("image2.jpg"));
static JLabel image3 = new JLabel(new ImageIcon("image3.jpg"));
static JLabel image4 = new JLabel(new ImageIcon("image4.jpg"));
static JLabel image5 = new JLabel(new ImageIcon("image5.jpg"));
static JLabel[] liste = {image1, image2, image3, image4, image5};
static int index=0;
}

Binary file not shown.

View File

@ -0,0 +1,18 @@
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
public class Listeimage{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
static JLabel image1 = new JLabel(new ImageIcon("./img/image1.jpg"));
static JLabel image2 = new JLabel(new ImageIcon("./img/image2.jpg"));
static JLabel image3 = new JLabel(new ImageIcon("./img/image3.jpg"));
static JLabel image4 = new JLabel(new ImageIcon("./img/image4.jpg"));
static JLabel image5 = new JLabel(new ImageIcon("./img/image5.jpg"));
static JLabel[] liste = {image1, image2, image3, image4, image5};
static int index=0;
}

Binary file not shown.

View File

@ -1,15 +1,18 @@
import java.awt.*; import java.awt.*;
import javax.swing.*; import javax.swing.*;
import java.util.*; import java.util.*;
import java.io.*;
public class Main{ public class Main{
static JFrame fenetre = new JFrame(); static JFrame fenetre = new JFrame();
static Galerie pan = new Galerie(); static Galerie pan = new Galerie();
ClassLoader loader = Thread.currentThread().getContextClassLoader();
InputStream file = loader.getResourceAsStream("Galerie.java");
public static void main(String[] args) { public static void main(String[] args) {
pan.add(Listeimage.image1); pan.add(Listeimage.liste[Listeimage.index]);
fenetre.setSize(250, 250); fenetre.setSize(250, 250);
fenetre.setLocation(250, 250); fenetre.setLocation(250, 250);
fenetre.addMouseListener(pan); fenetre.addMouseListener(pan);

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

View File

@ -0,0 +1,29 @@
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();
}
}

Binary file not shown.

View File

@ -0,0 +1,36 @@
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
public class Galerie extends JPanel implements MouseListener{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
InputStream file = loader.getResourceAsStream("Changement.java");
public Galerie(){
super();
}
public void mouseClicked(MouseEvent e){
int x = e.getX();
if (x <= this.getWidth()/5){
Changement.fenetreCliquer(0);
}else if(x >= (this.getWidth()/5)*4){
Changement.fenetreCliquer(1);
}
}
public void mouseEntered(MouseEvent evenement){
}
public void mouseExited(MouseEvent evenement){
}
public void mousePressed(MouseEvent evenement){
}
public void mouseReleased(MouseEvent evenement){
}
}

Binary file not shown.

View File

@ -0,0 +1,23 @@
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
public class Listeimage{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
InputStream file = loader.getResourceAsStream("img/image1.jpg");
InputStream file2 = loader.getResourceAsStream("img/image2.jpg");
InputStream file3 = loader.getResourceAsStream("img/image3.jpg");
InputStream file4 = loader.getResourceAsStream("img/image4.jpg");
InputStream file5 = loader.getResourceAsStream("img/image5.jpg");
static JLabel image1 = new JLabel(new ImageIcon("./img/image1.jpg"));
static JLabel image2 = new JLabel(new ImageIcon("./img/image2.jpg"));
static JLabel image3 = new JLabel(new ImageIcon("./img/image3.jpg"));
static JLabel image4 = new JLabel(new ImageIcon("./img/image4.jpg"));
static JLabel image5 = new JLabel(new ImageIcon("./img/image5.jpg"));
static JLabel[] liste = {image1, image2, image3, image4, image5};
static int index=0;
}

Binary file not shown.

View File

@ -0,0 +1,25 @@
import java.awt.*;
import javax.swing.*;
import java.util.*;
import java.io.*;
public class Main{
static JFrame fenetre = new JFrame();
static Galerie pan = new Galerie();
ClassLoader loader = Thread.currentThread().getContextClassLoader();
InputStream file = loader.getResourceAsStream("Galerie.java");
InputStream file2 = loader.getResourceAsStream("Listeimage.java");
InputStream file3 = loader.getResourceAsStream("Changement.java");
public static void main(String[] args) {
pan.add(Listeimage.liste[Listeimage.index]);
fenetre.setSize(250, 250);
fenetre.setLocation(250, 250);
fenetre.addMouseListener(pan);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fenetre.setContentPane(pan);
fenetre.setVisible(true);
}
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB