title: How can I convert input from JTextField into double. Input value is from user
body: <p>I'm trying to use an input from JTextField and turn it into double 'coz I'm gonna use the input in a mathematical formula in my program.. but when I try to run the codes, it gives an error.. I think I got the wrong way of parsing.. ANY HELP? Thanks!</p>
  
  <pre><code>    xLabel = new JLabel("Subject");
      xTF = new JTextField(4);
      xTF.addKeyListener(new KeyHandler());
      xString = xTF.getText();
      xDouble = Double.parseDouble(xString);
  </code></pre>