OK, so, I redid the file as an rtf. I can run it with the following code, but i loose the pictures. I've attached the rtf file (in rar compression). Any idea how to fix the pictures so they display?
import java.awt.*;
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.text.rtf.*;
import java.io.*;
public class RTFView extends JFrame
{
public static void main(String[] args)
{
// Create an instance of the test application
RTFView mainFrame = new RTFView();
mainFrame.setVisible(true);
}// end main()
public RTFView()
{
//Delcarations
int x = 800;
int y = 600;
String title = "RTF Viewer";
String file = "Method Doc.rtf";
setTitle(title);
setSize(x, y);
setBackground(Color.gray);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
getContentPane().setLayout(new BorderLayout());
JPanel topPanel = new JPanel();
topPanel.setLayout(new BorderLayout());
getContentPane().add(topPanel, BorderLayout.CENTER);
// Create an RTF editor window
RTFEditorKit rtf = new RTFEditorKit();
JEditorPane editor = new JEditorPane();
editor.setEditorKit(rtf);
editor.setBackground(Color.white);
// Scroll pane
JScrollPane scroller = new JScrollPane();
scroller.getViewport().add(editor);
topPanel.add(scroller, BorderLayout.CENTER);
// Load an RTF file
try
{
FileInputStream fi = new FileInputStream(file);
rtf.read(fi, editor.getDocument(), 0);
}
catch (FileNotFoundException e)
{
System.out.println("File not found");
}
catch (IOException e)
{
System.out.println("I/O error");
}
catch (BadLocationException e)
{
}
}// end RTFView()
}// end class