Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

open acrobat reader in swing component

 
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?

 
Rancher
Posts: 43016
76
  • 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.
 
Marshal
Posts: 69786
277
  • 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.
 
Rancher
Posts: 3191
29
  • 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
Rancher
Posts: 3191
29
  • 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.
 
Sheriff
Posts: 21972
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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.
 
    Bookmark Topic Watch Topic
  • New Topic