My image path doesn't work in jar file

I want to show a image on JLabel and then I deploy my project into a jar file.I use my code like this:

ImageIcon icon = new ImageIcon("C:/Documents and Settings/ram/Desktop/jeu de Nim/res/match.JPG");

setIcon(icon);

or

like this ;

ImageIcon icon = new ImageIcon("match.JPG");

setIcon(icon);

However,It doesn't work in other computer.I can't show it in the frame.When I make .jar file ,don't I use extra jar options or is there a bug in written code ?

[503 byte] By [celebissona] at [2007-11-26 17:11:52]
# 1

Is it your intent to put the image into the jar or will the image always be in "C:/Documents and Settings/ram/Desktop/jeu de Nim/res/match.JPG"

If you put the image in the jar, then obviously it won't be in c:\.... Instead, you use getClass(), getResource("match.JPG") instead.

Also, be sure that the file is named match.JPG and not, for example, match.jpg

atmguya at 2007-7-8 23:39:45 > top of Java-index,Desktop,Deploying...
# 2
I solved my problem.thank you for your help
celebissona at 2007-7-8 23:39:45 > top of Java-index,Desktop,Deploying...