title: Getting a numeric value form a text field
body: <p>SOLVED: I'm currently working on a program using Netbeans(JFrames) and I need to get a numeric value form a text field by using one of the '.get'.</p>
  
  <p>NEW PROBLEM: When doing the 'if statement' of the contactumber it is giving me an error saying that an int cannot be dereferenced. Any suggestions ?</p>
  
  <pre><code>    namevalidation.setText(""); //Set text for the label
      surnamevalidation.setText(""); //Set text for the label
      contactvalidation.setText(""); //Set text for the label
  
      String name = namefield.getText(); //Get text form a textfield
      String surname = surnamefield.getText(); //Get text form a textfield
      int contactnumber = Integer.parseInt(contactfield.getText()); //Getting the numeric value form the textfield
  
  
      boolean passed=true;
  
      if(name.isEmpty())//Checking if the name or surname is empty
      {
          namevalidation.setText("Please enter your name!");
          passed = false;
      }
  
      if(surname.isEmpty())
      {
          surnamefield.setText("Please enter your surname!");
          passed = false;
      }
      if(contactnumber.isEmpty()) //THIS IS GIVING ME AN ERROR
      {
          contactfield.setText("Please enter your number!");
          passed = false;
      }
  </code></pre>