1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| package Spangler;
import java.awt.Graphics;
import javax.swing.JPanel;
import java.awt.Image;
import javax.imageio.ImageIO;
import java.io.File;
import java.io.IOException;
public class Panel extends JPanel {
private Selection Selec;
public Panel()
{
Selec = new Selection();
this.Selec.SetRefpan(this);
this.Selec.start();
}
public void fond()
{
Graphics g =getGraphics();
try {
Image fond = ImageIO.read(new File("Images/Accueil/fond.jpg"));
g.drawImage(fond, 0, 0, this.getWidth(), this.getHeight(), this);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void Intro()
{
Graphics g =getGraphics();
Image intro;
try {
intro = ImageIO.read(new File("Images/Intro/Intro.jpg"));
g.drawImage(intro, 0, 0, this);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} |
Partager