// class5_InputDataDemoTwo.java: Entering input from input dialog boxes import javax.swing.JOptionPane; public class class5_InputDataDemoTwo { public static void main(String args[]) { // Prompt the user to enter a name: String name1 = JOptionPane.showInputDialog(null, "What is your name?", "Input Window Demo", JOptionPane.QUESTION_MESSAGE); // Display the result in a message dialog box JOptionPane.showMessageDialog(null, "Thank you, " + name1, "Input Window Demo", JOptionPane.INFORMATION_MESSAGE); System.out.println("The name entered was: " + name1); System.exit(0); } }