01: import javax.swing.JOptionPane; 02: 03: public class InputTest 04: { 05: public static void main(String[] args) 06: { 07: String input = JOptionPane.showInputDialog("How old are you?"); 08: if (input != null) 09: { 10: int age = Integer.parseInt(input); 11: age++; 12: System.out.println("Next year, you'll be " + age); 13: } 14: System.exit(0); 15: } 16: }