javais zapper beaucoup de truc...
This commit is contained in:
BIN
DEV3.1/Transitions/0495Snivy.png
Normal file
BIN
DEV3.1/Transitions/0495Snivy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 141 KiB |
BIN
DEV3.1/Transitions/0498Tepig.png
Normal file
BIN
DEV3.1/Transitions/0498Tepig.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 127 KiB |
BIN
DEV3.1/Transitions/0501Oshawott.png
Normal file
BIN
DEV3.1/Transitions/0501Oshawott.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 128 KiB |
89
DEV3.1/Transitions/fenetre.java
Normal file
89
DEV3.1/Transitions/fenetre.java
Normal 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) {}
|
||||
}
|
6
DEV3.1/Transitions/galerie.java
Normal file
6
DEV3.1/Transitions/galerie.java
Normal file
@@ -0,0 +1,6 @@
|
||||
public class galerie {
|
||||
public static void main(String[] args) {
|
||||
fenetre boum = new fenetre();
|
||||
boum.setVisible(true);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user