import java.util.StringTokenizer; import javax.swing.JOptionPane; // for GUI I/O public class UsingGUI { public static void main(String[] args) { String item = JOptionPane.showInputDialog(null, "Enter your age", "A Simple Program", JOptionPane.QUESTION_MESSAGE); StringTokenizer tokens = new StringTokenizer(item); int entered = Integer.parseInt(tokens.nextToken()); // display the message JOptionPane.showMessageDialog(null, "I'm not sure you are " + entered + "!", "Danger", JOptionPane.ERROR_MESSAGE); // exit the program System.exit(0); } // end of main method } // end of class UsingGUI