/**
   * @param doc
   * @return
   */
  private JPanel createForwardBackPanel(Document doc) {
    JPanel panel = new JPanel();
    JButton prev = new JButton("Prev");
    prev.setFont(font);
    prev.addActionListener(
        new ActionListener() {

          public void actionPerformed(java.awt.event.ActionEvent e) {
            previousFile();
          };
        });
    JButton next = new JButton("Next");
    next.setFont(font);
    next.addActionListener(
        new ActionListener() {

          public void actionPerformed(java.awt.event.ActionEvent e) {
            nextFile();
          };
        });
    fileNameField = new JTextField(doc.getDocumentId());
    fileNameField.setEditable(false);
    fileNameField.setFont(font);

    panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
    panel.add(prev);
    panel.add(Box.createHorizontalGlue());
    panel.add(fileNameField);
    panel.add(Box.createHorizontalGlue());
    panel.add(next);
    return panel;
  }
  public void setDoc(Document document) {
    predictionPanel.clear();

    doc = document;

    tvPanel.clearHighlights();
    displayRawText();

    predictionPanel.redraw();
    fileNameField.setText(doc.getDocumentId());
  }