// NameDialog.java: Fig 3.18 from Deitel & Deitel, Java: How to Program
// Basic input with a dialog box.
// Modified for CSC 121 - Spring 2005 
// Berry College - Nadeem Abdul Hamid

import javax.swing.JOptionPane;

public class NameDialog 
{
    public static void main( String args[] ) 
    {
        // prompt user to enter name
        String name =
            JOptionPane.showInputDialog( "What is your name?" );
        
        // create the message
        String message = "Welcome, " + name + ", to Java Programming!";
        
        // display the message to welcome the user by name
        JOptionPane.showMessageDialog( null, message );
        
        System.exit(0);
    } // end main
    
} // end class NameDialog