Acá mostramos como crear una animacion sencilla usando el método paint y un hilo

import java.util.Timer;
import java.util.TimerTask;
import java.awt.Graphics;
import java.awt.Color;
import javax.swing.JFrame;
import java.awt.Insets;

public class Animar extends JFrame {

private static int DELAY = 100;

Insets ins;

Color colores[] = { Color.RED, Color.YELLOW, Color.GREEN, Color.ORANGE,
Color.BLUE, Color.MAGENTA };

public void paint(Graphics g) {
super.paint(g);
if (ins == null) {
ins = getInsets();
}
// Calcula cada tiempo en caso de cambio de tamaño
int y = ins.top;
int x = ins.left;
int ancho = getWidth() – ins.left – ins.right;
int alto = getHeight() – ins.top – ins.bottom;
int empezar = 0;
int steps = colores.length;
int stepSize = 360 / steps;
synchronized (colores) {
for (int i = 0; i < steps; i++) {
g.setColor(colores[i]);
g.fillArc(x, y, ancho, alto, empezar, stepSize);
empezar += stepSize;
}
}
}

public void go() {
TimerTask tar = new TimerTask() {
public void run() {
Color c = colores[0];
synchronized (colores) {
System.arraycopy(colores, 1, colores, 0, colores.length – 1);
colores[colores.length – 1] = c;
}
repaint();
}
};
Timer timer = new Timer();
timer.schedule(tar, 0, DELAY);
}

public static void main(String args[]) {
Animar f = new Animar();
f.setSize(200, 200);
f.show();
f.go();
}
}