Assume that nameJTextField is a JTextField. Find the error(s) in the following code:
```
1 String name = nameJTextField.getText();
2
3 if name.equals( "John Doe" )
4 {
5 JOptionPane.showMessageDialog( "Welcome, John!",
6 JOptionPane.INFORMATION_MESSAGE )
7 }
```
1. Parentheses must be added around the if statement’s condition, name.equals( "John Doe" ). 2. The call to method JOptionPane.showMessageDialog has the wrong num- ber of arguments. An argument needs to be added before "Welcome, John!" that specifies where the dialog will be displayed on the screen. Another argument needs to be added after "Welcome, John!" that specifies the text that will display in the dialog’s title bar.
You might also like to view...
In query Design view, the query design workspace shows the fields that will be displayed when the query runs
Indicate whether the statement is true or false
Describe the TCP protocol.
What will be an ideal response?