double parse jtextfield

Solutions on MaxInterview for double parse jtextfield by the best coders in the world

showing results for - "double parse jtextfield"
Basile
19 Feb 2019
1public static void main(String[] args) {
2    double amount=0.0;
3    try {
4         amount = Double.parseDouble(txtMonth.getText());
5    } catch (Exception e) {
6        System.err.println("ups, this was not castable to double");
7          amount=-10.0;
8    }
9    System.out.println("Here is the double: "+ amount);
10}
Victoria
21 Oct 2020
1 double Amount = Double.parseDouble(txtMonth.getText());
Miley
21 Mar 2020
1Double Amount = Double.valueOf(txtMonth.getText());