how to remove all components from layeredPane java

Java
 panel.revalidate();
 panel.repaint();void    remove(int index)removeAll()remove(Component comp)
Source

Also in Java: