Pessoal,
To fazendo uma aplicação swing, onde tenho um jtable com uma jLabel nele, e nesta esta um ImageIcon de uma imagem que está no diretorio da aplicação, só que toda vez que eu troco a imagem por outra de mesmo nome e caminho o jLabel teria que modificar tbm, mas nem com repaint() ele muda.
Caso alguém saiba um obrigada!
...
JFileChooser jfc = new JFileChooser();
int returnVal = jfc.showDialog(NFe.this, "Ok");
if (returnVal == JFileChooser.APPROVE_OPTION) {
try {
File file = jfc.getSelectedFile();
BufferedImage imagem = ImageIO.read(file);
String extensao = file.getName().substring(file.getName().lastIndexOf("."), file.getName().length());
String url = getApplicationPath();
copiaArquivos(file.getAbsolutePath(), url + "\\src\\images\\logoEmitente" + extensao);
modificarLogoEmitente();
} catch (IOException ex) {
Logger.getLogger(NFe.class.getName()).log(Level.SEVERE, null, ex);
}
}
jfc.setSelectedFile(null);
}
public void modificarLogoEmitente() {
jPanel7.setLayout(new BorderLayout());
ImageIcon imagem = new ImageIcon("C:\\(DIRETORIO)\\images\\logoEmitente.jpg");
JLabel label = new JLabel(imagem);
jPanel7.add(label, BorderLayout.CENTER);
jPanel7.repaint();
}