/** * Class Demo * CSC211 Summer 2001 * @Author Anthony Larrain * */ import javax.swing.*; class InputDialog { public static void main( String [] argggg ) { // reference variable declaration String name; /** * Class JOptionPane has a static method showInputDialog * that pops up a simple dialog box (pop up window) with a textfield * and two buttons. Method showInputDialog takes a string as a paramter, * this parameter is used to label the textfield. * */ name = JOptionPane.showInputDialog("Enter your name "); System.out.println("Hello " + name ); System.exit(0); } }