This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Open a file on the desktop Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Open a file on the desktop" Watch "Open a file on the desktop" New topic
Author

Open a file on the desktop

Tiju Thomas
Greenhorn

Joined: May 25, 2008
Posts: 22
I have used the com.lowagie API to create a .pdf file in the workspace. How can I open it up in the acrobat reader and show to the user who is inside a swing application?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8439

If you are using JDK6, check out the Desktop class. It has a convenient method called open(File file)


[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
Tiju Thomas
Greenhorn

Joined: May 25, 2008
Posts: 22
Unfortunately, my client requires the project to be run on 5.0. Any other go?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8439

If you are on Windows, you can use
Tiju Thomas
Greenhorn

Joined: May 25, 2008
Posts: 22
Thanks much Maneesh, I could open the file using the above code.

I have seen the same code somewhere else but was not sure if this was the right way of openning a file through swing.

Anyways, thanks for the help.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Open a file on the desktop
 
Similar Threads
Open Dialog JFileChooser
Opening Word
use of Runtime.getRuntime().exec
Ant error: Make sure you have it in you classpath
pdc viewer software needed