I have attempted the following:
img = ImageIO.read(new File("/tmp/CampFire.gif"));
int x = (frame.getWidth() - buttonsPanel.getWidth() - img.getWidth(this))/2;
int y = frame.getHeight() - img.getHeight(this) - BORDER_HEIGHT; // BORDER_HEIGHT is a constant I made
g.drawImage(img, x , y, null);
but this does not animate the gif file. So I googled and found this:
Icon icon = new ImageIcon("/tmp/CampFire.gif");
JLabel label = new JLabel(icon);
JFrame frame = new JFrame();
frame.add(label);
which does animate the gif file but, to my knowledge, the coordinate system depends on a layout manager which is very difficult to implement in a "complex" simulation program. What I want is to easily tell Java where to put the gif file at the exact coordinate just like in my first code example (except with animation). Can someone please help me solve my problem?
Any help would be greatly appreciated!
Thanks in advance!