previous |
start |
next .... [Slide 37] ....
Reading Input
- Use input dialog:
String input = JOptionPane.showInputDialog("How old are
you?");
- If user cancels, result is null:
if (input != null) age = Integer.parseInt(input);

previous |
start |
next .... [Slide 37] ....