title: Parsing JTextfield String into Integer
body: <p>So I have this to convert <code>String</code> from <code>JTextField</code> to <code>int</code>. It says <code>Exception in thread "main" java.lang.NumberFormatException: For input string: ""</code>. Please help.</p>
  
  <pre><code> JTextField amountfld = new JTextField(15);
   gbc.gridx = 1; // Probably not affecting anything
   gbc.gridy = 3; //
   add(amountfld, gbc);
   String amountString = amountfld.getText();
   int amount = Integer.parseInt(amountString);
  </code></pre>