Here you can find the source of getDouble(javax.swing.JTextField input)
Parameter | Description |
---|---|
input | the JTextField object |
public static double getDouble(javax.swing.JTextField input) throws Exception
//package com.java2s; /*//w ww. j av a 2 s .co m * @(#)VerifyUtil.java * * Copyright (C) 2006 www.interpss.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE * as published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * @Author Mike Zhou * @Version 1.0 * @Date 09/15/2006 * * Revision History * ================ * */ public class Main { /** * Get double from the JTextField input * * @param input the JTextField object * @return the double number */ public static double getDouble(javax.swing.JTextField input) throws Exception { return new Double(input.getText()).doubleValue(); } /** * Get double from the input * * @param input the object, has to be instanceOf Double * @return the double number */ public static double getDouble(Object input) { return ((Double) (input)).doubleValue(); } /** * Get double from the JComboBox input * * @param input the JComboBox object * @return the double number */ public static double getDouble(javax.swing.JComboBox input) throws Exception { return new Double((String) (input.getSelectedItem())).doubleValue(); } }