1: import javax.swing.*; 2: 3: public class StringDemoGui 4: { 5: public static void main(String[] args) 6: { 7: String input; 8: 9: input = JOptionPane.showInputDialog("Enter a string: "); 10: JOptionPane.showMessageDialog(null, "You entered " + input); 11: System.exit(0); 12: } 13: }