title: How to read doc file using Poi?
body: <p>I am trying to view word file in my editor pane 
  I tried these lines </p>
  
  <pre><code>import java.awt.Dimension;
  import java.awt.GridLayout;
  import java.io.File;
  import java.io.FileInputStream;
  import javax.swing.JEditorPane;
  import org.apache.poi.hwpf.HWPFDocument;
  import org.apache.poi.hwpf.extractor.WordExtractor;
  
  public class editorpane extends JEditorPane
  {
  public editorpane(File file)
  {
  
      try
      {
          FileInputStream fis = new FileInputStream(file.getAbsolutePath());
          HWPFDocument hwpfd = new HWPFDocument(fis);
          WordExtractor we = new WordExtractor(hwpfd);
          String[] array = we.getParagraphText();
          for (int i = 0; i &lt; array.length; i++)
          {
              this.setPage(array[i]);
          }
  
      } catch (Exception e)
      {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>but gives me </p>
  
  <pre><code>org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)
  at org.apache.poi.poifs.storage.HeaderBlock.&lt;init&gt;(HeaderBlock.java:131)
  at org.apache.poi.poifs.storage.HeaderBlock.&lt;init&gt;(HeaderBlock.java:104)
  at org.apache.poi.poifs.filesystem.POIFSFileSystem.&lt;init&gt;(POIFSFileSystem.java:138)
  at org.apache.poi.hwpf.HWPFDocumentCore.verifyAndBuildPOIFS(HWPFDocumentCore.java:106)
  at org.apache.poi.hwpf.HWPFDocument.&lt;init&gt;(HWPFDocument.java:174)
  at frame1.editorpane.&lt;init&gt;(editorpane.java:24)
  </code></pre>
  
  <p>in this line </p>
  
  <pre><code>HWPFDocument hwpfd = new HWPFDocument(fis);
  </code></pre>
  
  <p>how can I solve that ??</p>
  
  <p>beside I am not sure about these lines</p>
  
  <pre><code>for (int i = 0; i &lt; array.length; i++)
          {
              this.setPage(array[i]);
          }
  </code></pre>
  
  <p>can I get them confirmed ??</p>