File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes open a file in the external default program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "open a file in the external default program" Watch "open a file in the external default program" New topic
Author

open a file in the external default program

C?cile Hayez
Greenhorn

Joined: Dec 09, 2002
Posts: 1
Alright... this is what I wish to do, coding in java :
I work with html, pdf, ... files in my java program and I wish to be able, within the program, to open those files launching the default external program defined by the user in his operation system (like for exemple nescape or iexplorer to open a html file, acrobat for a pdf, ...).
Does anyone knows how I can do that?
Thanks in advance
Zippy 007
karl koch
Ranch Hand

Joined: May 25, 2001
Posts: 388
hi
on a window system try the following:
open the command prompt and type "start yourfile", hit enter. then yourfile is opened using the registered application for that type of file.
you can do the same from a java programm trough the Runtime.exec() method.

this is very platform dependant, i hope somebody here can give you a hint on how to do this.
greets,
k
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: open a file in the external default program