是不是下面的方法都用完了,还是不行吧
background = new ImageIcon("D://ClientData//result.jpg");
resultLabel.setIcon(background);
resultLabel.repaint();
resultLabel.updateUI();
resultLabel.setVisible(true);
试一下这种方法:
String path = "D://ClientData//result.jpg";
Icon icon;
try {
icon = new ImageIcon(ImageIO.read(new File(path)));
resultLabel.setIcon(icon);
} catch (IOException e) {
e.printStackTrace();
}