jeudi 19 février 2015

images not get loaded after jar creation


Vote count:

0




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..{}



asked 38 secs ago







images not get loaded after jar creation

Aucun commentaire:

Enregistrer un commentaire