I am trying the code below to open and read a Word file in JTextArea, using Netbeans.
import java.io.*;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.extractor.WordExtractor;
public class ReadDocFile {
    public static void main(String[] args) {
        File file = null;
        WordExtractor extractor = null;
        try {
            file = new File("c:\\New.doc");
            FileInputStream fis = new FileInputStream(file.getAbsolutePath());
            HWPFDocument document = new HWPFDocument(fis);
            extractor = new WordExtractor(document);
            String[] fileData = extractor.getParagraphText();
            for (int i = 0; i < fileData.length; i++) {
                if (fileData[i] != null)
                    System.out.println(fileData[i]);
            }
        } catch (Exception exep) {
        }
    }
}
I get the error below:
cannot find symbol : HWPFDocument((mypackgename).fileinputstream )
Due to this, I can not open the file. Is there a reason that this isn't working?
 
    