title: How to test if a HashSet Contains something in a TextField
body: <p>I have been trying to test if my text field contains whatever is in my hashset but for some reason it is not working here is my code :</p>
  
  <pre><code>int WrongCounter = 0;
  int RightCounter =1;
  boolean isOver = false;
  while(!isOver){
      question.setText("You have a "+RandomWord.length()+" letter word " + set);
      char input = scan.next().charAt(0);
      hangMan(WrongCounter);
      if(set.contains(ansField.getText().charAt(0))){
          set.remove(ansField.getText().charAt(0));
          right.setText("You are right");
          RightCounter++;
      }
      else if(!(set.contains(ansField.getText().charAt(0)))){
  
          right.setText("You are wrong!");
          WrongCounter++;
      }
      if(set.size()==0||WrongCounter ==8){
          isOver = true;
          hangMan(WrongCounter);
      }
  </code></pre>
  
  <p>here is the hangMan method</p>
  
  <pre><code>private void hangMan(int wrongCounter) {
  
  
          switch(wrongCounter){
          case 1:
              hangMan.setText("     -------|\n     |\n     |\n     |\n___|___");
              break;
          case 2 :
              hangMan.setText("     -------|\n     |\n     |\n     |\n___|___");
  
              break;
          case 3:
              hangMan.setText("     -------|\n     |            O\n     |\n     |\n___|___");
              break;
          case 4 : 
              hangMan.setText("     -------|\n     |            O\n     |           /\n     |\n___|___");
              break;
          case 5:
              hangMan.setText("     -------|\n     |            O\n     |           /|\n     |\n___|___");
              break;
          case 6 :
              hangMan.setText("     -------|\n     |            O\n     |           /|\\\n     |\n___|___");
              break;
          case 7 :
              hangMan.setText("     -------|\n     |            O\n     |           /|\\\n     |           /\n___|___");
              break;
          case 8 : 
              hangMan.setText("     -------|\n     |            O\n     |           /|\\\n     |           / \\n___|___");
              break;
          }
  
      }
  </code></pre>
  
  <p>Whenever I try this program it crashes and I have no Idea why</p>