title: unreported exception must be caught or declared to be thrown
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/908672/why-do-i-get-exception-must-be-caught-or-declared-to-be-thrown-when-i-try-to">Why do I get “Exception; must be caught or declared to be thrown” when I try to compile my Java code?</a>  </p>
  </blockquote>
  
  
  
  <p>Thanks guy for solving my first issue, i am now getting a new error </p>
  
  <pre><code>import java.io.*;
  import javax.swing.*;
  
  public class FileBrowser {
      public static void main(String[] args) throws IOException {
  
          JFileChooser chooser = new JFileChooser();
          chooser.showOpenDialog(null);
          File file = chooser.getSelectedFile();
          String filename = file.getName();
          System.out.println("You have selected: " + filename);
  
          FileReader fr = new FileReader("filename"); 
          BufferedReader br = new BufferedReader(fr); 
          String s; 
          while((s = br.readLine()) != null) { 
              System.out.println(s); 
          } 
          fr.close(); 
      }
  }
  </code></pre>
  
  <p>Error :</p>
  
  <pre><code>java.io.FileNotFoundException: filename (The system cannot find the file specified)
      at java.io.FileInputStream.open(Native Method)
      at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:138)
      at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:97)
      at java.io.FileReader.&lt;init&gt;(FileReader.java:58)
      at FileBrowser.main(FileBrowser.java:13)
  </code></pre>
  
  <p>is the error where it is not properly getting the file name from the file browser ?</p>