I'm trying to place a GIF as wallpaper, the problem is that the GIF does not occupy the entire screen. How can I fix it so that the GIF occupies the whole screen so that even if the window size is changed, it keeps occupying everything?
This is my code:
public class ViewInicio extends JFrame {
private JLabel fondo;
public ViewInicio() {
setLayout(new BorderLayout()); setSize(1500,900); setTitle("View Inicio"); setMinimumSize(new Dimension(700, 700)); setIconImage(new ImageIcon(getClass().getResource("/resources/icon.png")).getImage()); setDefaultCloseOperation(EXIT_ON_CLOSE);
fondo = new JLabel(); fondo.setIcon(new ImageIcon(getClass().getResource("/hundirlaflotilla/resources/fondo.gif"))); getContentPane().add(fondo);
setVisible(true); } }