Код: Выделить всё
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
//Salvar imagem temporaria para exibição
String text = jTextArea1.getText();
String export = "src/main/resources/scripts/temp/temp.png";
String type = "png";
File folder = new File("src/main/resources/scripts/temp");
if(folder.exists() && folder.isDirectory()){
Util.exec(text, export, type);
}else{
folder.mkdir();
Util.exec(text, export, type);
}
imageReload();
}
Код: Выделить всё
public void imageReload(){
jLabel2.setIcon(null);
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/scripts/temp/temp.png")));
jLabel2.revalidate();
jLabel2.repaint();
}
Код: Выделить всё
jButton1Код: Выделить всё
jLabel2Код: Выделить всё
Util.exec()Я пытался искать другие способы обновления метки, но видел решения только с помощью repaint() и revalidate()
Подробнее здесь: https://stackoverflow.com/questions/790 ... anel-image
Мобильная версия