+2  A: 

You could draw it on a JPanel by overriding the paintComponent method.

Use a Timer to tick every second to redraw the clock. The timer fires ActionEvents which your panel could listen for.

As for drawing, the center of the boxes with the numbers can be calculated with a bit of trigonometry. For the hour boxes: x = sin(hour / 12 * 2 * pi) and y = cos(hour / 12 * 2 * pi). For the minute boxes: x = sin(minute / 60 * 2 * pi) and y = cos(minute / 60 * 2 * pi). These will be relative to the center of the clock and will need to be multiplied by some constant. Actually, those equations might not be quite right, but the way to do it is something like that.

David Johnstone
+2  A: 

This page on Java 2D looks like it might be a good place to start. Disclaimer: I've never seriously dealt with Java graphics before.

_jameshales
A: 

http://www.jhlabs.com/java/layout/index.html

provides a ClockLayout layoutmanager

Peter
+1  A: 

I found some code in this posting which I believe is actually fairly close to what you want. It shows how to draw multiple sprites in a circle about a given point. It even does animation at 1/10 of a second. Slow it down to 60 minutes and its close to what you want.

Note, the code doesn't compile as posted. Just comments out the 2 statements in error and it should work fine.

camickr
A: 

If you want a really general answer...

Make objects to represent everything that moves on screen. Have the objects know their own position and the direction they are facing. Every few milliseconds, update the objects' position and direction data and then clear and redraw the screen.

So in this specific case, the clock face would be a background that never changes, and the hands would be objects. Every millisecond, use something like David's formulas to calculate the hands' new positions and directions and then draw them.

snake