Bonjour tout le monde; j'essaye dans ce code java d'afficher une image mais ça ne marche pas, rien ne s'affiche ! quelqu'un peut m'aider? merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
 
import javax.imageio.ImageIO;
 
 
public class AfficherImage {
	static BufferedImage S=null;
	static Graphics2D g;
 
	public static void main(String[]args)
	{
		try {
		    S= ImageIO.read(new File("c:\\ortrho25eparse.jpg"));
 
	       } catch (IOException e) { System.out.println("erreur de nom de file");}
	       g =S.createGraphics();
	       g.drawImage(S, 0, 0, null);
 
 
	}
 
 
 
}