Charger une Image dans un Panel
Salut les devs j'ai un problème avec Comment charger une Image dans un panel,en effet je le fais deja mais il y a petit probleme,lorsque je charge pour la 1ere fois ça fonctionne et quand je refais l'image s'affiche à moitié
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
fop=new FileDialog(this);
fop.show();
BufferedImage image=null;
try {
image= ImageIO.read(new File(fop.getDirectory()+fop.getFile()));
this.jPanel1.getGraphics().drawImage(image,0, 0, this.jPanel1.getSize().width,this.jPanel1.getSize().height,this);
} catch (IOException ex) {
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
} |