Check out example codes for "double parse jtextfield". It will help you in understanding the concepts better.

Code Example 1

double Amount = Double.parseDouble(txtMonth.getText());

Code Example 2

public static void main(String[] args) {
    double amount=0.0;
    try {
         amount = Double.parseDouble(txtMonth.getText());
    } catch (Exception e) {
        System.err.println("ups, this was not castable to double");
    System.out.println("Here is the double: "+ amount);

Code Example 3

Double Amount = Double.valueOf(txtMonth.getText());

Learn ReactJs, React Native from