title: Java have a int value using setText
body: <p>I'm trying to set an int value using jTextField and the setText method. But of course setText wants a String. How do I get round this? I'll give you a snippet of the code:</p>
  
  <pre><code>    private void setAllTextFields(FilmSystem e){
      getFilmNameTF().setText(e.getFilmName());
      lectureTF.setText(e.getLecture());
      ageTF.setText(e.getAge());
      priceTF.setText(e.getTicketCost());
      seatsTF.setText(e.getNoOfSeats());
  </code></pre>
  
  <p>seatsTF is a jTextField and getNoOfSeats is a method in another class that returns a int value.</p>
  
  <p>Thanks again for answering this question. Now how would I go about getting the value of the int to do something to do?</p>
  
  <pre><code>        public void buyTicket() {
      String newFilmName = filmNameTF.getText();
      String newLecture = lectureTF.getText();
      String newAge = ageTF.getText();
      String newPrice = priceTF.getText(); 
      int newSeats = seatsTF.
  </code></pre>
  
  <p>As you can see the code, the String values I can get easy with getText. I can then print them out or whatever with them. How can I do this with the seats int? Thanks again.</p>