I have made a software in core java and this software will be executed on PC so I have made jar of my software and executed jar on my pc. jar is executing properly but as i have used images on jbutton so those images are not getting loaded when i execute jar. jbutton and images not shown and creating problem for my whole software... as when i am loading images on jbutton is like this...
public BufferedImage loadImage(String fileName){
BufferedImage buff = null;
try {
buff = ImageIO.read(getClass().getResourceAsStream(fileName));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
return buff;
}
btn.setIcon(new ImageIcon(loadImage("/images/index.jpeg")));
kindly help..