Meaningless Drivel is fun!
The moose likes Swing / AWT / SWT and the fly likes reading pdf,ppt,doc in swing app Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "reading pdf,ppt,doc in swing app" Watch "reading pdf,ppt,doc in swing app" New topic

reading pdf,ppt,doc in swing app

Murasoli Maran
Ranch Hand

Joined: Jun 08, 2003
Posts: 193
Hi all,
how to make a swing form(Frame) to read pdf,ppt,doc,xls files to display the contents in a pane such as JEditorPane()?.
anybody knows?.i need an overview.
Murasoli Maran
Ranch Hand

Joined: Jun 08, 2003
Posts: 193
no way?
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

JEditorPane has to have an associated EditorKit to display specific types of content. You then register the specific EditorKit with a MIME type on the JEditorPane.

I don't know of any PDF, DOC, PPT, or XLS EditorKits... Instead of spending the time to implement an EditorKit to render the document inside a JEditorPane, most people just use Runtime.exec() to launch the file in it's associated program outside of the Java program. You could probably make EditorKits for all of these filetypes, but it would take a while.

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

Joined: Nov 27, 2002
Posts: 451
You may want to take a look at Jakarta POI - Java API To Access Microsoft Format Files.

kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg
Murasoli Maran
Ranch Hand

Joined: Jun 08, 2003
Posts: 193
thanks ken...great find.
I agree. Here's the link:
subject: reading pdf,ppt,doc in swing app
It's not a secret anymore!