javais zapper beaucoup de truc...

This commit is contained in:
2023-09-20 12:11:33 +02:00
parent d934da10c1
commit f8b2e47118
24 changed files with 1243 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

View File

@@ -0,0 +1,89 @@
import java.awt.CardLayout;
import java.awt.BorderLayout;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.*;
public class fenetre extends JFrame implements MouseListener{
int imgN = 0;
String[] imgs = {"DEV3.1/Transitions/0495Snivy.png","DEV3.1/Transitions/0498Tepig.png","DEV3.1/Transitions/0501Oshawott.png"};
public fenetre()
{
super();
this.setSize(1000, 1000);
this.setLocation(0, 0);
this.add(new JLabel(new ImageIcon(this.imgs[this.imgN])),BorderLayout.CENTER);
addMouseListener(this);
}
public void next()
{
}
public void previous()
{
}
public void nextOld()
{
if (this.imgN+1>=imgs.length)
{
this.imgN = 0;
}
else
{
this.imgN++;
}
this.getContentPane().removeAll();
this.add(new JLabel(new ImageIcon(this.imgs[this.imgN])),BorderLayout.CENTER);
this.repaint();
this.revalidate();
}
public void previousOld()
{
if (this.imgN-1<0)
{
this.imgN = imgs.length-1;
}
else
{
this.imgN--;
}
this.getContentPane().removeAll();
this.add(new JLabel(new ImageIcon(this.imgs[this.imgN])),BorderLayout.CENTER);
this.repaint();
this.revalidate();
}
@Override
public void mouseClicked(MouseEvent e)
{
if (e.getX()<this.getWidth()/2)
{
this.previousOld();
}
else
{
this.nextOld();
}
}
@Override
public void mouseEntered(MouseEvent e) {}
@Override
public void mouseExited(MouseEvent e) {}
@Override
public void mousePressed(MouseEvent e) {}
@Override
public void mouseReleased(MouseEvent e) {}
}

View File

@@ -0,0 +1,6 @@
public class galerie {
public static void main(String[] args) {
fenetre boum = new fenetre();
boum.setVisible(true);
}
}