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 TestResponseBox2
{
    
    public static void main (String[] args)
    {
        MainWindow   mainWindow;
        MessageBox 	 messageBox;
        ResponseBox  selectTemperature;  
        int choice;
        
        mainWindow  = new MainWindow("Test ResponseBox");
        messageBox  = new MessageBox( mainWindow );
        
        selectTemperature 
                    = new ResponseBox(mainWindow,2);
                    
        mainWindow.setVisible( true );
        
        selectTemperature.setLabel(ResponseBox.BUTTON1, "Celsius");
        selectTemperature.setLabel(ResponseBox.BUTTON2, "Fahrenheit");
        
        choice = selectTemperature.prompt("Celsius or Fahrenheit?");
        
        if (choice == ResponseBox.BUTTON1) {
        
            messageBox.show(" Show temperature in Celsius");
        }
        else {
        
            messageBox.show(" Show temperature in Fahrenheit");
        }    
    }
    
}