Sounds a bit like a deck of cards what you've got, a simple way to do it is override an existing class, its paint method and preferred size, such as JButton. I actually did use overrode the JButton class for a simple card game. The class below works best if both images are the same size or the first image displayed is the largest though it could be rewritten. For simple animation guess you could just create an array with each animation image in it and display them alternatively, though admittedly I'm no Walt Disney.
Code:
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class ImageFlip extends JButton implements ActionListener
{
private Dimension picSize;
private boolean isFaceUp=false;
private Image front,back;
public ImageFlip(Image im1,Image im2)
{
front=im1;
back=im2;
picSize=new Dimension(front.getWidth(this),front.getHeight(this));
this.setPreferredSize(picSize);
this.setBorderPainted(false);
addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
repaint();
isFaceUp= ! isFaceUp;
}
public Dimension getPrefferedSize()
{
return picSize;
}
public void paint(Graphics g)
{
super.paint(g);
if(isFaceUp)
g.drawImage(back,0,0,this);
else
g.drawImage(front,0,0,this);
}
}