import javax.swing.JFrame;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class TetrisSimulator {
    private static final int FRAME_WIDTH = 315;
    private static final int FRAME_HEIGHT = 380;
    
    public static void main (String [] args) {
        
        
            JFrame frame = new JFrame ("Tetris Simulator");
            frame.setSize (FRAME_WIDTH, FRAME_HEIGHT);
            
            frame.addWindowListener
            (new WindowAdapter () {
                public void windowClosing (WindowEvent e) {
                    System.exit (0);
                }
            }
            );
            
            Grid grid = new Grid (20, 20);
            Simulator ca = new TSimulator (FRAME_HEIGHT, FRAME_WIDTH, grid);
            Container content = frame.getContentPane ();
            
            // Add classes to the simulation.
           ca.addClass ("MobileSimObject");
  
         
            if (content != null) {
                content.add (ca, BorderLayout.CENTER);
            } else {
                System.err.println ("ERROR: No content pane");
            }
            
            frame.show ();
        }
        
    
    
}