filmov
tv
Java programming, Use JOptoinPane.showInputDialog to get user input, program display user's input

Показать описание
This video is created by Golden West College student, Jordan Morris
E 1.15
Type in and run the following program:
public class DialogViewer
{
public static void main(String[] args)
{
}
}
Then modify the program to print “Hello, name!”, displaying the name that the user typed in.
E 1.16
Modify the program from Exercise E1.15 so that the dialog continues with the mes- sage “My name is Hal! What would you like me to do?” Discard the user’s input and display a message such as
I'm sorry, Dave. I'm afraid I can't do that.
Replace Dave with the name that was provided by the user.
E 1.15
Type in and run the following program:
public class DialogViewer
{
public static void main(String[] args)
{
}
}
Then modify the program to print “Hello, name!”, displaying the name that the user typed in.
E 1.16
Modify the program from Exercise E1.15 so that the dialog continues with the mes- sage “My name is Hal! What would you like me to do?” Discard the user’s input and display a message such as
I'm sorry, Dave. I'm afraid I can't do that.
Replace Dave with the name that was provided by the user.