|
Java™ by example!
|
|
|
How do I render RTF documents?
JEditorPane is able to display and edit different kinds of content. By default, text/plain, text/html and text/rtf are recognized and passed on to the EditorKit that is designed to handle it: DefaultEditorKit, HTMLEditorKit and RTFEditorKit. In the following example, a URL can be given in a JTextField. Clicking GO will invoke the setPage method on the JEditorPane that will load the page into a default document and set the content type. Using the mime type of the page, the pane will automatically detect the correct EditorPane to use. Try: http://www.yahoo.com and http://www.esus.com/richtext.rtf
Further Information
Author of answer: Joris Van den Bogaert
Comments
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|