Do you have to use Swing? This sort of thing seems to be easier to pull off with AWT. I have a small framework that demonstrates the basics for this sort of thing. Don't let the size of some of the classes scare you. Just take a look at the
approach and see if you can see how to use it for a Tetris hack.
SpaceScene.java {B]SpaceSceneManager.java[/B]
SpaceObject.java Ship.java TestShip.java Some of the other SpaceObject classes are not here, if you want I'll post everything later. See if you can follow my logic. Basically the SpaceScene is responsible for calling the update() method on all registered SpaceObjects. The
Applet or application just starts an animation loop and on each cycle calls update() on the SpaceScene object. A Tetris hack will be much simpler than this since there are only four possible orientations. There is no collision detection in this but it would be simple to add to the SpaceScene implementation since it has knowledge of all the SpaceObjects in the scene.
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher