package sample;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.BorderLayout;
import java.awt.Image;
import java.io.File;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
JFrame frame = new JFrame();
frame.setBounds(0, 0, 852, 576);
frame.getContentPane().setLayout(null);
JLabel label = new JLabel("");
label.setBounds(133, 13, 519, 451);
frame.getContentPane().add(label);
String path = "C:\\Login.jpg";
File file = new File(path);
Image image = ImageIO.read(file);
label.setIcon(new ImageIcon(image));
frame.setVisible(true);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
path = "\u202AC:\\Users\\成\\Desktop\\阿珂.jpg";
file = new File(path);
image = ImageIO.read(file);
label.setIcon(new ImageIcon(image));
}
}