Here you can find the source of queryDouble(String message, double initialValue)
Parameter | Description |
---|---|
message | a parameter |
initialValue | a parameter |
Parameter | Description |
---|---|
Exception | an exception |
public static double queryDouble(String message, double initialValue) throws Exception
//package com.java2s; /*// w w w . j a v a 2 s . c o m * Copyright (C) 2010-2014 Andreas Maier * CONRAD is developed as an Open Source project under the GNU General Public License (GPL). */ import javax.swing.JOptionPane; public class Main { /** * Queries the User for a Double values using Swing. * @param message * @param initialValue * @return the chosen double * @throws Exception */ public static double queryDouble(String message, double initialValue) throws Exception { String input = JOptionPane.showInputDialog(message, "" + initialValue); if (input == null) throw new Exception("Selection aborted"); return Double.parseDouble(input); } }