Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

double parse jtextfield

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");
          amount=-10.0;
    }
    System.out.println("Here is the double: "+ amount);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #double #parse #jtextfield
ADD COMMENT
Topic
Name
1+3 =