// ShapesTest.java: Fig 5.27 from Deitel & Deitel, Java: How to Program
// Test application that displays class Shapes
//
// Modified for CSC 121 - Spring 2005 
// Berry College - Nadeem Abdul Hamid

import javax.swing.JFrame;
import javax.swing.JOptionPane;

public class ShapesTest {

    public static void main( String args[] ) {
        // obtain user's choice
        String input 
            = JOptionPane.showInputDialog("Enter 1 to draw rectangles\n" +
                                          "Enter 2 to draw ovals" );
        
        int choice = Integer.parseInt( input ); // convert input to int
        
        // create the panel with the user's input
        Shapes panel = new Shapes( choice );

        JFrame application = new JFrame(); // creates a new frame

        application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        application.getContentPane().add( panel );
        application.setSize( 300, 300 );
        application.setVisible( true );

    } // end method main

} // end class ShapesTest
