Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import javax.swing.text.JTextComponent;

public class Main {
    public static double getDoubleTextField(double defaultValue, JTextComponent c) {
        try {
            return Double.parseDouble(c.getText());
        } catch (RuntimeException re) {
            return defaultValue;
        }
    }
}