title: getText() method doesn't work with integers
body: <pre><code>textfield2.addActionListener(new ActionListener()
  {
      public void actionPerformed(ActionEvent actionevent)
      {
          String input = textfield2.getText();
          Output2.setText("Your age is " + (2017-input));
      }
  });
  
  button2.addActionListener(new ActionListener()
  {
      public void actionPerformed(ActionEvent actioneven)
      {
          String input = textfield2.getText();
          Output2.setText("Your age is " + (2017 -input));
      }
  });
  </code></pre>
  
  <p>I am trying to get a number from the user (an integer) and subtract that number from 2017. It gives an error saying that it is a String and I can't subtract a number from a String. When I change <code>String input</code> to <code>int input</code> it gives errors again. It says that I can't use <code>getText()</code>. I've tried few ways such as <code>parseInt()</code> and it did not work. How can I fix this problem?</p>
  
  <p>My Question is different from <a href="https://stackoverflow.com/questions/5585779/how-to-convert-a-string-to-an-int-in-java">How to convert a String to an int in Java?</a> because I looked at the answers there and they didn't really work with my code.</p>