February 2014
Beginner
1248 pages
62h 25m
English
Line 10 uses JOptionPane method showInputDialog to display an input dialog containing a prompt and a field (known as a text field) in which the user can enter text. Method showInputDialog’s argument is the prompt that indicates what the user should enter. The user types characters in the text field, then clicks the OK button or presses the Enter key to return the String to the program. Method showInputDialog returns a String containing the characters typed by the user. We store the String in variable name. If you press the dialog’s Cancel button or press the Esc key, the method returns null and the program displays the word “null” as the name.
Read now
Unlock full access