Tetris is a classic and durable game, and it has been popular all over the world. And it’s an ideal sample for leaning object-oriented programming. It can be implemented by different object-oriented programming languages that exist nowadays.
This thesis describes the implementing process of this game in java language, which is implemented in application form instead of applet that embedded in the web pages. The use of swing component makes the interface look more professional. The game designs in the process to involve to the game frame, the compilation of game contact surface, menu processing, the definition of variable, the design of algorithm as well as the realization of the function of preview are involved in the process of designing this game. Meanwhile, some other functions are also added to the game, such as designing “About dialog”, achieving the archive of the game scores, adding status bar to the game.
Through this thesis we can learn how to define classes, class members and the methods, how to use JBuilder to create works, how to create a dialog, and how to link the dialog box and the main application.