• Post Reply Bookmark Topic Watch Topic
  • New Topic

open acrobat reader in swing component

 
Anil kumar Sakala
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing one swing application
Is there any way where we can open Acrobat Reader inside a swing component like panel?

 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. But the https://pdf-renderer.dev.java.net/ project is a Swing component that can display PDFs in pure Java.
 
Campbell Ritchie
Marshal
Posts: 52589
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you use Runtime.exec() for that?

But it looks a technique fraught with possible errors, so you should not try Runtime.exec() unless you have read Michael Daconta's classic article which this search should find: when Runtime.exec() won't.
 
Rob Camick
Ranch Hand
Posts: 2700
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JDK6 you can use the Desktop class to open the file in the default application for the given file type.
 
Anil kumar Sakala
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Runtime object we can launch external programs but we cannot make acrobat reader to appear in swing component ......

I am not sure about desktop classs .Can any one try and give me some sample code so that i can use it.
 
Rob Camick
Ranch Hand
Posts: 2700
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure about desktop classs


What error messages did you get when you tried it?

Read the API, search the web and you will find examples.
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Desktop.open will also not open the PDF document in Swing but will also just call the system default application (Acrobat Reader) as a separate process.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!