import javabook.*;

/*
 * Introduction to OOP with Java 2nd Edition, McGraw-Hill
 *	
 *   A sample program that illustrates the basic use of ResponseBox
 *   from Section 7.4.
 *   
 *  
 * @author Dr. Caffeine
 *
 */
class TestResponseBox1
{
    
    public static void main (String[] args)
    {
        MainWindow   mainWindow;
        MessageBox 	 messageBox;
        ResponseBox  yesNoBox;  
        
        mainWindow  = new MainWindow("Test ResponseBox");
        yesNoBox    = new ResponseBox( mainWindow );
        messageBox  = new MessageBox( mainWindow );
        
        mainWindow.setVisible( true );
        
        int selection;

        selection = yesNoBox.prompt("Click a button");
        
        switch (selection) {
          
            case ResponseBox.YES:
                      messageBox.show("Yes button was clicked");
                      break;
          
            case ResponseBox.NO:
                      messageBox.show("No button was clicked");
                      break;
        }
    }
    
}