1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
/* Affichage de la carte */
JPanel panelmap = new JPanel(){
private static final long serialVersionUID = 1L;
protected void paintComponent(Graphics g) {
super.paintComponen();
try {
BufferedImage image = ImageIO.read(new File("bin/res/luca_pic.jpg"));
BufferedImage goodImage = scale(image,1.2);
int w = goodImage.getWidth();
int h = goodImage.getHeight();
g.drawImage(goodImage, (getWidth()-w)/2, (getHeight()-h)/2, null);
g.dispose();
} catch (IOException e) {
e.printStackTrace();
}
}
}; |