I\'m in the process of writing a Java 2D game. I\'m using the built-in Java 2D drawing libraries, drawing on a Graphics2D I acquire from a BufferStrategy from a Canvas in a
make sure you use double buffering, draw first to one big buffer in memory that you then flush to screen when all drawing is done.
There are couple of things you will need to keep in mind
1) is refreshing this link shows how to use swingtimers which might be a good option for calling repaint. Getting repaint figured out (as the previous posters have said is important so you're not doing too much work).
2) Make sure you're only doing drawing in one thread. Updating UI from mulitple threads can lead to nasty things.
3) Double Buffering. This makes the rendering smoother. this site has some more good info for you
An alternative if you don't want to go pure Java 2D is to use a game library such as GTGE or JGame (search for them on Google), then offer easy access to graphics and also offer double buffering and much simpler drawing commands.