title: java program compiles with no error but does not run
body: <p>Here is my code after changes suggested by stackoverflow members. The code compiles with no errors but when I run "java Realtor11", I get the following errors. I am importing the correct libraries so not sure what the issue is. </p>
  
  <p>The goal of the program is to read two values (first line is a string (John) and the second line is a double (100)) and output them with some calculations to a JOption message. </p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.NullPointerException 
            at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
            at java.lang.Double.parseDouble(Unknown Source)
            at Realtor11.main(Realtor11.java:49)</p>
  </blockquote>
  
  <pre><code>// java class for keyboard I/O
  import java.util.Scanner;
  // java class for JOption GUI
  import javax.swing.JOptionPane;
  // File reader
  import java.io.BufferedReader;
  import java.io.FileReader;
  import java.io.IOException;
  import java.io.InputStream;
  
  public class Realtor11
  {
      public static void main(String[] args)
      {
      // Keyboard and file input
          Scanner console = new Scanner(System.in); 
          Scanner inputStream = null;
      // price of the house, the cost to sell the house and the commission
          double price = 0;
          double cost, commission;
      // seller's name
          String seller = "name";
  
  
  
  // GUI diplay message declaration
      String display_message = "This program calculates the cost to sell a home\n" 
      + "and the commission paid to an individual sales agent.\n\n"
      + "The user is asked for the last name of the seller and the\n"
      + "sales price.\n\n";
  
  // Output descriptive messages
      JOptionPane.showMessageDialog(null, display_message, "Lab 1 Description", JOptionPane.INFORMATION_MESSAGE);
  
  // Read Realtor11.txt
      try {
          BufferedReader in = new BufferedReader(new FileReader("Realtor11.txt"));
          while (in.read()!= -1);
          seller = in.readLine();
          price = Double.parseDouble(in.readLine());
          in.close();
          } 
  
          catch (IOException e) {}
  
  
  // calculate the cost and the commission
      cost = 0.06 * price;
      commission = 0.015 * price;
  // display the input and results
      String 
          out1 = String.format("%nThe " + seller + "'s" + " home sold for $%.2f%n", price),
          out2 = String.format("The cost to sell the home was $%.2f%n", cost),
          out3 = String.format("The selling or listing agent earned $%.2f%n", commission);
  
      JOptionPane.showMessageDialog(null, out1 + out2 + out3, seller + "'s Home Sale", JOptionPane.INFORMATION_MESSAGE);
  
  // Output to file
  // still writing this. 
  
  }
  </code></pre>
  
  <p>}</p>