Я хочу открыть загрузочный GIF на 5 секунд, а затем переключиться на другой GIF, но я не могу переключиться
Я пробовал frame.dispose (), Panel.removeAll () имножество других функций
setSize(1366, 768);
setLocation(0, 0);
setDefaultCloseOperation(EXIT_ON_CLOSE);
JPanel p = new JPanel();
ImageIcon image = new ImageIcon("C:\\Users\\user\\Desktop\\hmi-loading.gif");
JLabel imagelabel = new JLabel(image);
imagelabel.setBackground(Color.BLACK);
imagelabel.setForeground(Color.BLACK);
p.setBackground(Color.BLACK);
p.add(imagelabel);
getContentPane().add(p);
p.removeAll();
frame.removeAll();
p.setBackground(Color.BLACK);
ImageIcon imagee = new ImageIcon("C:\\Users\\user\\Desktop\\kAi.gif");
JLabel imagelabel1 = new JLabel(image);
imagelabel1.setBackground(Color.BLACK);
imagelabel1.setForeground(Color.BLACK);
p.setBackground(Color.BLACK);
p.add(imagelabel1);
getContentPane().add(p);
Это один gif. Как добавить таймер, чтобы заменить этот таймер на другой?
Я ожидаю, что gif будет заменен надругой.GIF открывается, и это все.