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

public class TurtlesAndFrogs {
    private static final int FRAME_WIDTH = 520;
    private static final int FRAME_HEIGHT = 590;

    public static void main (String [] args) {
	JFrame frame = new JFrame ("Turtles and Frogs");
	
	frame.addWindowListener 
	    (new WindowAdapter () { 
		    public void windowClosing (WindowEvent e) {
			System.exit (0);
		    }
		}
	     );
	
	Grid grid = new Grid (10, 10);   
	Simulator ca = new Simulator (FRAME_HEIGHT, FRAME_WIDTH, grid);
	Container content = frame.getContentPane ();

	// Add classes to the simulation.  
        ca.addClass ("Frog");
        ca.addClass ("Turtle");
	  ca.addClass ("HostileFrog");
	
	if (content != null) {
	    content.add (ca, BorderLayout.CENTER);
	} else {
	    System.err.println ("ERROR: No content pane");
	}

	frame.pack ();
	frame.show ();
    }
}