Ciao a tutti!!!
devo visualizzare un'immagine su un panel, ma il seguente codice mi dà l'eccezzione
Can't read input file
grazie Ciao
Codice PHP:public class JPGPanel extends JPanel
{
BufferedImage bufferedImage;
public JPGPanel() {
try {
File file = new File("C:\\Users\\Lh\\DesktopAssembly_line negozio informatica.jpg");
bufferedImage = ImageIO.read(file);
} catch (IOException ex) { Logger.getLogger(JPGPanel.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void paint(Graphics g) {
g.drawImage(bufferedImage,0,0,this);
}
}

Rispondi quotando
