Using a scanner as a parameter
<p>I am having some trouble with my code. I am trying to test a few things. The goal is to scan the selected file for money values with dollar signs (These would be strings and output them as a double.) I know the code is not a 100 percent ready but I can't seem to be getting it to scan the file at all.</p>

<p>Console output. I think it must be how I have the scanner/scanner parameter set up.</p>

<pre><code>Exception in thread "main" java.lang.NumberFormatException: For input string: "SUMMARY"
    at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
    at java.lang.Double.parseDouble(Unknown Source)
    at assignment03.FinancialTransactions.scanMoneyValue(FinancialTransactions.java:47)
    at assignment03.FinancialTransactions.main(FinancialTransactions.java:38)



import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import javax.swing.JFileChooser;

public class FinancialTransactions {

    /** Transaction Checker
     *  January 25, 2013 
     * @throws FileNotFoundException 
     */

    public static void main(String[] args) throws FileNotFoundException 
    {
        JFileChooser chooser;
        chooser = new JFileChooser;

        chooser.setDialogTitle ("Which file would you like to check?");

        int result = chooser.showOpenDialog (null);

        if (result==JFileChooser.CANCEL_OPTION)
        {
            return; //Returns if the user cancels.
        }

        File inputFile = chooser.getSelectedFile();
        //Testing a few things.
        //System.out.println("The file is: " + inputFile);

        Scanner in = new Scanner(inputFile);

        double f;
         f = scanMoneyValue(in);
        System.out.println(f);
    }


    public static double scanMoneyValue (Scanner in)
    {
        String nextWord = in.next();
        double d;
        d=Double.parseDouble(nextWord);
        return d;

    }
</code></pre>
