This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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: 42974
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: 24086
54
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: 42974
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?
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!