title: Java method to count the characters of a string
body: <p>I have a string named text and I want to count the number of its characters.
  But there is no method 'count' like in ObjC.</p>
  
  <p>In the Internet I found the method 'length', which could be useful. But If I write:</p>
  
  <pre><code>private javax.swing.JTextField txtText;
      int counter = txtText.length();
  </code></pre>
  
  <p>the compiler complains: "cannot find the symbol"</p>
  
  <p>I thought I need a framework to include, I am absolutely new in Java.</p>