我试图制作一个显示图像 3 秒然后切换它的程序,但不是显示第一个图像等待然后显示第二个图像它的等待显示第一个图像然后显示第二个图像谢谢你的帮助
JLabel image = new JLabel("");
image.setBounds(100, 20, 125, 200);
contentPane.add(image);
image.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent me) {
image.setIcon(one);
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
image.setIcon(two);
}
});