import javax.swing.JOptionPane; public class ExP1_8 { public static void main(String[] args) { // This version does not provide a default value for the text entry... String name = JOptionPane.showInputDialog(null, "What is your name?", "RSGC Student Identification Dialog", JOptionPane.INFORMATION_MESSAGE); // Comment out the previous statement and activate the next one // for an example of a default entry in the text box... // Object name = JOptionPane.showInputDialog(null,"What is your name?","RSGC Student Identification Dialog",JOptionPane.INFORMATION_MESSAGE,null,null,"Dave"); JOptionPane.showMessageDialog(null, "Hello, " + name+'.', "Identification Confirmed", JOptionPane.INFORMATION_MESSAGE); } }