Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Tetris-App/TetrisApp.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
27 lines (24 sloc)
913 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.JFrame; | |
import javax.swing.JPanel; | |
/** | |
* Write a description of class TetrisApp here. | |
* | |
* @author Greg Johnson, University of Connecticut | |
* @version 0.3 | |
*/ | |
public class TetrisApp extends JFrame{ | |
private GamePanel _gamePanel; | |
public TetrisApp(){ | |
super("Tetris"); | |
this.setResizable(false); | |
_gamePanel = new GamePanel(); | |
_gamePanel.setPreferredSize(new java.awt.Dimension(TetrisConstants.BLOCK_SIZE*TetrisConstants.BOARD_WIDTH, TetrisConstants.BLOCK_SIZE*TetrisConstants.BOARD_HEIGHT + 22)); | |
this.setSize(TetrisConstants.BLOCK_SIZE*TetrisConstants.BOARD_WIDTH, TetrisConstants.BLOCK_SIZE*TetrisConstants.BOARD_HEIGHT+22); | |
this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); | |
this.add(_gamePanel); | |
this.setVisible(true); | |
} | |
public static void main(String[] args){ | |
TetrisApp app = new TetrisApp(); | |
} | |
} |