title: Convert TextField value to Int
body: <p>I have a TextField where I can type values; And I need to convert the value typed to Int and display it with S.O.Println.</p>
  
  <pre><code>EDIT:
  </code></pre>
  
  <p>I've tried now :</p>
  
  <pre><code>try {
  int i = Integer.parseInt(myText.getText());
  System.out.println("This is an integer " + i);              
  }
  catch (NumberFormatException x) {
  System.out.println("Error : "+ x.getMessage());
  }
  </code></pre>
  
  <p>But it's giving me :</p>
  
  <pre><code>This is an integer 122                // When I type 122
  Error : For input string: "122,5"     // When I type 122,5
  Error : For input string: "122.5"     // When I type 122.5
  </code></pre>
  
  <p>Any ideas.</p>
  
  <p><strong><code>EDIT:</code></strong></p>
  
  <p>This is it :</p>
  
  <pre><code>double d = Double.parseDouble(myText.getText());
  int i = (int)d;
  </code></pre>