title: Adding a TextField to JOptionPane
body: <p>I am working on a simple program that displays "Hello" and accepts user input using JOptionPane. I wanted to read the users input and compare it to the word that is displayed. For example, the program will display "Hello" and the user would have to input a word into the text box. If they type "Hello" then "Correct" will print. If they don't type Hello then "Incorrect" will print. In order to read the users input and compare the two strings, what do I need to do?</p>
  
  <pre><code>public static void main(String[] args){
  
      String resp = "Hello";
  
      JOptionPane.showInputDialog(null, resp);
  
      String input = ; //what should go here                              
  
      if (resp.compareTo(input) == 0) {
          JOptionPane.showMessageDialog(null, "Correct!");
          } else
          JOptionPane.showMessageDialog(null, "Incorrect");
          }
      }
  }
  </code></pre>