• Post Reply Bookmark Topic Watch Topic
  • New Topic

Show file .doc in una panel or JTextArea  RSS feed

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody!!!

i'm i want open one file .doc or .docx and insert in una panel or one JTextArea....

in my JTextArea append only file .txt

how to do???

help!!!
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> how to do???

what did google turn up?
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt that there are non-commercial Swing objects that can display structured document formats like those. Some basic RTF and HTML - yes, but DOC/X - no.
 
paul beppe
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have seen on google libraries org.apache.poi able to read formats. doc and. docx ...
I can't understand how to use them to get what you want ...
 
Sheriff
Posts: 23451
46
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

paul beppe wrote:I have seen on google libraries org.apache.poi able to read formats. doc and. docx ...
I can't understand how to use them to get what you want ...



That's because reading those formats is very different from rendering them in a GUI. In other words, you can't use those products (which were designed to read those formats) to display data in a GUI.
 
paul beppe
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!!!

in this days i have search do soluction....

in java i can convert the file .doc/x to .html

and later insert html setected in JTextArea....

it's possible???

if possible how to do???

help me please!!!
 
Ulf Dittmer
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may be able to use OpenOffice in server mode to convert structured formats; check out the JODConverter library.

The best quality approach might be to convert the document to PDF, and then use the PDF-Renderer library to display it - it comes with a Swing component for displaying PDFs.

That begs the question, though: why convert the document at all? Why not use Desktop.open(...) to use a native application?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!