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

public class TetrisApplet extends JApplet {
    private static final int FRAME_WIDTH = 315;
    private static final int FRAME_HEIGHT = 380;
    final static int GRID_ROWS = 20;
    final static int GRID_COLUMNS = 20;

    public TetrisApplet () {
	JRootPane pane = getRootPane ();
	//@assume pane != null
	pane.putClientProperty ("defaultSystemEventQueueCheck", Boolean.TRUE);
    }

    public void init() {
	//@assume pane != null
	Grid grid = new Grid (20, 20);
	Simulator ca = new TSimulator (FRAME_HEIGHT, FRAME_WIDTH, grid);
	Container content = 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");
	}
    }
}