Java JTextField Number readDoubleFromField(JTextField inField, double defaultValue)

Here you can find the source of readDoubleFromField(JTextField inField, double defaultValue)

Description

read Double From Field

License

Open Source License

Declaration

public static double readDoubleFromField(JTextField inField, double defaultValue) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.JTextField;

public class Main {
    public static double readDoubleFromField(JTextField inField, double defaultValue) {
        try {//from w  w w.  j a va2 s . c  o  m
            return Double.valueOf(inField.getText());
        } catch (Exception e) {
            return defaultValue;
        }
    }
}

Related

  1. getNum(JTextField txt, double defaultNum)
  2. getNumber(JTextField field, Integer defaultInt)
  3. largeEqualThan(javax.swing.JTextField input, double x)
  4. parseIntFromField(JTextField jField, int pDefault)
  5. placeDoubleTextInField(JTextField inField, int length, double toPlace)
  6. setNumericAndCharOnly(final javax.swing.JTextField textField)
  7. setTextField(javax.swing.JTextField textField, double value, int precision)
  8. showInDecimalFormat(JTextField pJTextField)
  9. validateDoubleInput(Component parentComponent, JLabel label, JTextField textField, String valueDescription, String errorTitle, boolean positiveValue, boolean showMessage, boolean valid)