title: Java : reading all files
body: <p>I am attempting to read in files into a java application running via netbeans.  I have been successful in previewing the files, but I can only preview .txt files.  How can I alter my code to read in any file(s)?  (eg. .doc, .docx, .pdf, .jpg, .png).</p>
  
  <pre><code>JFileChooser share = new JFileChooser();
  share.showOpenDialog(null);
  File f = share.getSelectedFile();
  String fileName = f.getAbsolutePath();
  
      try {
          FileReader reader = new FileReader(fileName);
          BufferedReader br = new BufferedReader(reader);
          jTextArea1.read(br, null);
          br.close();
          jTextArea1.requestFocus();
      }
      catch(Exception e) {
          JOptionPane.showMessageDialog(null, "File not found", "Error", JOptionPane.ERROR_MESSAGE);
      }
  </code></pre>