wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Displaying document contents Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Displaying document contents" Watch "Displaying document contents" New topic
Author

Displaying document contents

Narayanan Jayaraman
Ranch Hand

Joined: Apr 09, 2003
Posts: 52
I would like to display the contents of a word document or XML document. What is the best approach for it ? TextArea component or do I need to use JEditorPane for this ?. Thanks
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

JTextArea displays plain text, so it wouldn't work with Word documents, but it could display the XML markup (as plain text) fine.

JEditorPane displays styled text... it will display RTF files (but not Word DOC files), text, and HTML. It can display XML fine too.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Narayanan Jayaraman
Ranch Hand

Joined: Apr 09, 2003
Posts: 52
Any tips on how to add XML file into JEditorPane ? Thanks
Narayanan Jayaraman
Ranch Hand

Joined: Apr 09, 2003
Posts: 52
I got it to work . Thanks!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Displaying document contents
 
Similar Threads
Java Api for MS Word Table Handling
jsp page contents in the word document
Reading PDF Files from a Java program
Converting Document Object to String
A pretty absurd question