So for my project I just wanted the backgound to have a gif play to make it look nicer, but every solution I found wouldnt work. A solution where I make the gif on a JLabel then add everything onto the JLabel didnt work, the project ran but nothing showed up on screen. I have the gif called as this
ImageIcon obj = new ImageIcon("assets/animate.gif");
My main looks like this
public static void main(String[] args0) {
JFrame frame = new JFrame("inferdle");
gamePanel window = new gamePanel();
frame.add(window);
frame.setSize(500,900);
frame.setVisible(true);
frame.setResizable(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
and I extend JPanel in the beggining. There are a bunch of box's that I add and those boxs have a bunch of JButtons
hBox.add(sMenu);
jBox.add(tMenu);
add(hBox, BorderLayout.NORTH);
add(jBox, BorderLayout.SOUTH);
add(textBox, BorderLayout.EAST);
Is this even possible?