This week's book giveaway is in the General Computing forum.
We're giving away four copies of Learning Regular Expressions and have Ben Forta on-line!
See this thread for details.
Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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: 23714
50
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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!