/*
 * @topic T11340 Spring 2016 Inheritance Demo
 * @brief GUI classes demonstrating inheritance
*/
package inheritance_demo;

public class MainApp {

    public static void main( String[] args ) {
        Window win = new Window( 300/*width*/, 150/*height*/ );
        win.attach( new TextBox( 30, 5 ) );
        win.attach( new TextBox( 30, 5 ) );
        win.attach( (new Button( 30, 5 )).setCaption("OK") );
        win.attach( (new Button( 30, 5 )).setCaption("Cancel") );
        
        win.show();
        win.userClicks( "OK" );
        win.userClicks( "Cancel" );
        
        IClick handler = new EventHandler();
        win.attachHandler( "OK", handler );
        win.attachHandler( "Cancel", handler );
        
        win.userClicks( "OK" );
        win.userClicks( "Cancel" );
    }//main

}//class MainApp