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 How do I open a Windows program from a Java 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 "How do I open a Windows program from a Java program?" Watch "How do I open a Windows program from a Java program?" New topic
Author

How do I open a Windows program from a Java program?

Matthew Alesi
Ranch Hand

Joined: Sep 13, 2006
Posts: 38
Just a simple task I'm trying to do in a program I made: it produces an HTML file which I subsequently want Internet Explorer to open up and print out. I have everything working up to the point where I need to open IE...and then I realized I don't know how. How can I do this?'

Thanks!


-Matt
Current CS undergrad
SCJP 5.0
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Opening IE for a specific page or file is easy enough. Just use Runtime.exec() to run "iexplore file://whatever.html". Getting IE to print thereafter though, that is hard. Is there any reason why you want IE to print the file? You could just use the Java Print Service API to do it without the involvement of IE.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502

If you want to do OS specific things, you can use RunTime.exec(..);

To execute find the code snippet,



Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />prabhu.venkatachalam@gmail.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I open a Windows program from a Java program?