Game loop using Swing?
Hey everyone. My simple game engine currently uses Swing for the frames and components, but uses an AWT Canvas for the actual game display. I'm trying to figure out how to change entirely to Swing components.
Here's basically how I've laid out my game loop thread using Canvas:
1. Do calculations since last loop
2. Get Graphics2D object via the canvas' BufferStrategy object
3. Clear the background with white.
4. Call the draw(Graphics2D) method.
5. Dispose & flip the buffer.
6. Call the update(long) method using the calculations from step 1.
7. Sleepfor a bit.
8. Repeat loop
This is working very smoothly right now and is very flexible for subclassing. But since it's a mix of Swing & AWT there are some problems here and there and I feel it could be improved by keeping it Swing-only.
What's the best way to implement a similar game thread loop using a Swing component?
Code can be supplied if needed. Thanks!

